Thread Subject: Faceted Mesh plots

Subject: Faceted Mesh plots

From: Iain

Date: 25 Nov, 2008 17:43:02

Message: 1 of 2

Hi,

I have been having problems colouring in a mesh plot. When using the figure editor, it is no problem, I just highlight the input mesh and go to faces (paintpot icon) - faceted(flat) . I would really like to do this through code, I have tried using 'shading' which I think (thought!) is the correct function for this. Using a classic Matlab example...

figure
[X,Y] = meshgrid(-3:.125:3);
Z = peaks(X,Y);
mesh(X,Y,Z);
axis([-3 3 -3 3 -10 5])

shading faceted
colorbar

The axis handles should be right as the colorbar call is happy, so I guess I am not using shading correctly.

Any help much appreciated!!!!
Iain

Subject: Faceted Mesh plots

From: Ryan Ollos

Date: 30 Nov, 2008 07:13:05

Message: 2 of 2

"Iain " <icw26@cam.ac.uk> wrote in message <gghdf5$dk1$1@fred.mathworks.com>...
> Hi,
>
> I have been having problems colouring in a mesh plot. When using the figure editor, it is no problem, I just highlight the input mesh and go to faces (paintpot icon) - faceted(flat) . I would really like to do this through code, I have tried using 'shading' which I think (thought!) is the correct function for this. Using a classic Matlab example...
>
> figure
> [X,Y] = meshgrid(-3:.125:3);
> Z = peaks(X,Y);
> mesh(X,Y,Z);
> axis([-3 3 -3 3 -10 5])
>
> shading faceted
> colorbar
>
> The axis handles should be right as the colorbar call is happy, so I guess I am not using shading correctly.
>
> Any help much appreciated!!!!
> Iain

You might try File > Generate M-file after you have prepared your figure manually. This will auto-generate the code for you that prepares the figure. You can then edit or copy and paste portions of into your custom script. That might help you figure out where the error is in your code. I'm not sure what version they added this feature, but I'm guessing it was >= R14.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
shading Iain 25 Nov, 2008 12:45:04
faceted Iain 25 Nov, 2008 12:45:04
flat Iain 25 Nov, 2008 12:45:04
mesh Iain 25 Nov, 2008 12:45:04
rssFeed for this Thread

Contact us at files@mathworks.com