From: Wendy on
Hi all,

I am making a surf plot. However, I found the Z values are plotted on the grid points of the plot. Is there a way that I can make one grid (square) represent a value? For example, I make a surface plot for data
x = 1:3;
y = 1:3;
[X,Y]=meshgrid(x,y);
Z = [2 7 3;
9 7 5;
6 4 2];
surf(X,Y,Z)
view(2)

The surf plot would only have two columns of squares. I understand the values are plotted on the vertices and the colours are interpreted from 4 adjacent vertices. Is there a way that I can make the plot consisted of 3 columns, and each represent one column of values? Does anyone know any function does that?

Thank you
Wendy
From: Cokelid on
> Is there a way that I can make the plot consisted of 3 columns, and each represent one column of values?

Are you looking for a 3D plot? In your example bar3(Z) might do what
you're after perhaps?

Justin
From: Walter Roberson on
Wendy wrote:

> I am making a surf plot. However, I found the Z values are plotted on
> the grid points of the plot. Is there a way that I can make one grid
> (square) represent a value?

That's more towards the 'bar' family of functions, perhaps bar3() ?