Histogram or heatmap with self-defined values.
Mostrar comentarios más antiguos
Hello all,
I would like to have a heatmap or histogram 2D (whichever works better) that plots values in the boxes I specify.
Example:
X = [1;2;3];
Y = [10;20;30];
mainvalue = [4;76;8];
array = [X,Y,mainvalue];
So if X has the value 2 and Y has the value 20, for example, then mainvalue has the value 76.
Basically I try to change the height of the bins with fixed values from a vector (here mainvalue).
This is how it should look, except that the bins contain the values of mainvalue:

Axis labeling does not match example!
4 comentarios
Your 3x1 vectors x, y, and mainvalue are not sufficient for a 2D heatmap or bivariate histogram. In these cases, you would need a 3x3 matrix of mainvalue data so that each pair of (x,y) has a value. What you describe are data along the diagonal but no other values off of the diagonal.
Example:
x = [1 2 3];
y = [5 6 7];
data = rand(3)
heatmap(x,y,data)
Lukas Schmid
el 7 de Oct. de 2022
Lukas Schmid
el 7 de Oct. de 2022
Adam Danz
el 7 de Oct. de 2022
I've replied with an answer below.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

