Path: news.mathworks.com!not-for-mail
From: "Iain " <icw26@cam.ac.uk>
Newsgroups: comp.soft-sys.matlab
Subject: Faceted Mesh plots
Date: Tue, 25 Nov 2008 17:43:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 17
Message-ID: <gghdf5$dk1$1@fred.mathworks.com>
Reply-To: "Iain " <icw26@cam.ac.uk>
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 1227634982 13953 172.30.248.37 (25 Nov 2008 17:43:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 25 Nov 2008 17:43:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1393101
Xref: news.mathworks.com comp.soft-sys.matlab:503140


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