Plotting with pcolor or similar plotting tool

I want to plot this data, so that these values show in rectangular grids
1070 5088 5720 6047 3859
507 376 454 297 588
With pcolor I would require three rows to create a 2x5 rectangular grid (and from bottom to top, not top to bottom).
How can I plot this data as displayed, in a 2x5 rectangular grid
Thanks for any answers :)

回答 (1 件)

Image Analyst
Image Analyst 2015 年 2 月 20 日

0 投票

As you found out, pcolor() chops off the last column and last row of your data and is not suitable. Use imshow() instead:
m=[1070 5088 5720 6047 3859
507 376 454 297 588]
imshow(m, [], 'InitialMagnification', 1600)
colormap(jet(256));
colorbar;
axis on;
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
Note: axes tick marks indicate the center of the pixels, so the center of the lower left pixel is located at x=1, y=2.

2 件のコメント

Oliver
Oliver 2015 年 2 月 23 日
That's great, how do you make the colours 50% transparent? Thanks :)
Oliver
Oliver 2015 年 2 月 23 日
Also, how can I get it so the y axis ascends on the bottom, i.e. 0.5 to 2.5 vertically? Thanks :)

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

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

2015 年 2 月 20 日

コメント済み:

2015 年 2 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by