Using multiple pcolor lines to graph

4 ビュー (過去 30 日間)
Wafa'a Shanti
Wafa'a Shanti 2018 年 5 月 10 日
コメント済み: Wafa'a Shanti 2018 年 5 月 13 日
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.

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 5 月 11 日
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 件のコメント
Walter Roberson
Walter Roberson 2018 年 5 月 12 日
I think the lower = 0 should be inside the "for tupper" loop, before the "for upper".
Wafa'a Shanti
Wafa'a Shanti 2018 年 5 月 13 日
I just tried this, and the same results happened. I noticed thought that I was mistaken- when I add the 'hold on' function, the resulting graph only has the first pcolor-line, and does not include the rest. Is there supposed to be another line of code for pcolor that I am missing?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by