Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Faceted Mesh plots
Date: Sun, 30 Nov 2008 07:13:05 +0000 (UTC)
Organization: PhysioSonics Inc
Lines: 20
Message-ID: <ggtee1$1on$1@fred.mathworks.com>
References: <gghdf5$dk1$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228029185 1815 172.30.248.37 (30 Nov 2008 07:13:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 30 Nov 2008 07:13:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129061
Xref: news.mathworks.com comp.soft-sys.matlab:503879


"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.