Ploting the data as a colormap?

I have a data as
x values are 100 and 200, y values are 1 and 5. I also have 4 values for the intersection points of x and y values. For example (100,1)=1114.8 and (200,1)= 1711.6 and (100,5)= 826 and (200,5)=1370,4
I want to plot the values as a 2D colored surface as below http://www.mathworks.com/help/techdoc/ref/colormap_1.png but in addidtion a colorbar scale nearby which scales the values from 700 to 1900 for the intersection points.
Is it possible?
Thanks in advance!

 採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 8 月 16 日

0 投票

You have so little data. Maybe something like this:
x=[100 100 200 200];
y=[1 5 5 1];
z=[1114.8 826 1370.4 1711.6 ];
patch(x,y,z);colorbar;

1 件のコメント

Özgür
Özgür 2011 年 8 月 16 日
Hi, thanks for your help this is the exact thing which I want to do.
I also found another way to get the same result
X = [1,5]
Y=[100,200]
h = [1114.8 826; 1711.6 1370.5]
[X,Y]=meshgrid(X,Y)
contourf(X,Y,h)
but when I used "patch(x,y,z);colorbar;" it seems better.

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

その他の回答 (0 件)

カテゴリ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by