Using multiple pcolor lines to graph
Ältere Kommentare anzeigen
Hello. I have a quick question. I have taken 11 data sets and have found a mean temperature at a certain height and time. I then plotted these values in pcolor to create a heatmap. However, when plotting and whether I used 'hold on' or 'hold off' I found that the graph would only plot the first line of pcolor, or the last. Is there anything I need to do in order to have all 11 lines of pcolor plot? Thank you in advance.
Antworten (1)
Walter Roberson
am 11 Mai 2018
0 Stimmen
If you are trying to say that you are getting out 10 color faces instead of 11 color faces, then the answer is that you cannot do that in pcolor. pcolor is surf() followed by view(2). surf() interpolates the color of faces at the center of the four vertices that define the corners of the face, so surf() and thus pcolor() will always have one fewer row and one fewer column than the input data.
If your data is on a regular grid instead of at irregular locations (pcolor and surf permit irregular locations) then I suggest you use imagesc() instead of pcolor().
You could also look at using warp(), which does permit irregular locations.
5 Kommentare
Wafa'a Shanti
am 11 Mai 2018
Walter Roberson
am 11 Mai 2018
If you had "hold on" after the first pcolor() then everything would be plotted. However, you are placing everything at exactly the same location, and you are making everything opaque.
You need to decide how you want the data to be drawn together:
- take the mean at each location over the 11 matrices and draw that
- take the minimum at each location etc
- take the maximum at each location etc
- take the median at each location etc
- convert each value in each matrix into a color, and take the mean of the RGB components and draw that
- convert each value in each matrix into a color, and take the maximum of each RGB components and draw that
- convert each value in each matrix into a color, convert the RGB to HSV, take the mean of the HSV components, convert back to RGB and draw that
- do not change any value, draw them all, but impose transparency on them -- if you do then remember that each alpha operation is layered so an alpha value of 1/10 that is two layers down does not have the same total contribution to the output as an alpha value of 1/10 on the top layer.
Wafa'a Shanti
am 12 Mai 2018
Walter Roberson
am 12 Mai 2018
I think the lower = 0 should be inside the "for tupper" loop, before the "for upper".
Wafa'a Shanti
am 13 Mai 2018
Kategorien
Mehr zu Data Distribution Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!