Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
contourf without lines

Subject: contourf without lines

From: Heiko Hoffmann

Date: 28 Jul, 2003 13:17:34

Message: 1 of 6

I would like to make a plot like contourf, but without the
contour-lines drawn on top of the filled areas. How can I do that?

Subject: contourf without lines

From: W. Dale Hall

Date: 28 Jul, 2003 18:48:17

Message: 2 of 6



Heiko Hoffmann wrote:
> I would like to make a plot like contourf, but without the
> contour-lines drawn on top of the filled areas. How can I do that?

Check out the documentation for contourf, and note that there is one
mode like this:

>> [C,h,CF] = contourf(myArray, myVals);

What gets returned in the variables C,h,and CF are (from the
documentation):


C is a two-row matrix specifying all the contour lines.

h is a vector of handles to "patch" objects

and

CF is a contour matrix for the filled areas.


The handles h each have property "LineStyle", and if
you set that value to 'none', it draws no line.

>> for q=1:length(h)
set(h(q),'LineStyle','none');
end

will do the trick. There may well be a way to do this
without a loop, but I haven't found one.

Dale

Subject: contourf without lines

From: us

Date: 28 Jul, 2003 14:52:18

Message: 3 of 6

a hint:
     v=peaks(64);
     [cv,ch]=contourf(v);
% with
     shading flat
% -or- the equivalent
     set(ch,'edgecolor','none');


us


Heiko Hoffmann wrote:
> I would like to make a plot like contourf, but without the
contour-lines drawn on top of the filled areas.

Subject: contourf without lines

From: W. Dale Hall

Date: 28 Jul, 2003 21:44:31

Message: 4 of 6



W. Dale Hall wrote:
>
>

... mumble ...

>
> The handles h each have property "LineStyle", and if
> you set that value to 'none', it draws no line.
>
> >> for q=1:length(h)
> set(h(q),'LineStyle','none');
> end
>
> will do the trick. There may well be a way to do this
> without a loop, but I haven't found one.
>
> Dale
>

Thanks to the article by us, I've found out that the
above loop is completely superfluous. Golly.

Thanks, us.

Me.

Subject: contourf without lines

From: Uwe Sydow

Date: 29 Jul, 2003 21:53:41

Message: 5 of 6

"Heiko Hoffmann" <heikohoff@web.de> wrote in news:eec1719.-
1@WebX.raydaftYaTP:

> I would like to make a plot like contourf, but without the
> contour-lines drawn on top of the filled areas. How can I do that?
>

shading flat

e.g.:

n=number_of_colors_to_be_used=16;
z=peaks(50);
contourf(z,n), shading flat

Uwe

Subject: contourf without lines

From: Heiko Hoffmann

Date: 30 Jul, 2003 06:06:17

Message: 6 of 6

Many thanks for the numerous replies.
Adding "shading flat"
showed to work very fine.


Heiko

Tags for this Thread

No tags are associated with this thread.

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.

Contact us