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
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com