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개)

카테고리

도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by