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!

 Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 16 Août 2011

0 votes

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 commentaire

Özgür
Özgür le 16 Août 2011
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Color and Styling dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by