Tags: background, code, color, contourf, everybodyi, followsx, map, matlab, meshgrid, plot, programming, sample, scale
contourf color map scale
On Programmer » Matlab
933 words with 3 Comments; publish: Wed, 07 May 2008 17:01:00 GMT; (20042.97, « »)
Hello everybody
I am trying to plot using contourf. I need the background as white.
Sample code is as follows:
[X,Y] = meshgrid(-3:.2:3,-3:.2:3);
Z = X.^2+Y.^2;
v = 2:0.2:20;
length(v)
contourf(X,Y,Z,v)
This works well. But when I add
shading flat
it gives following error
Warning: Patch FaceVertexCData length (1) must equal Vertices length
(61) for flat EdgeColor.
Does anybody have a solution.
Thanks in advance
TS
http://matlab.itags.org/q_matlab_9963.html
All Comments
Leave a comment...
- 3 Comments

- Hi,
this snippet works well on my PC
Jrme
#1; Wed, 07 May 2008 17:02:00 GMT

- Jrme wrote:
> this snippet works well on my PC
I mean it's just a warning !
Jrme
#2; Wed, 07 May 2008 17:03:00 GMT

- Last, read the documentation about PATCH object :
<http://www.mathworks.com/access/hel.../ref/patch.html>
Jrme
#3; Wed, 07 May 2008 17:04:00 GMT