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:
pcolor and contour on same axis

Subject: pcolor and contour on same axis

From: Chuck37

Date: 6 Aug, 2010 22:36:04

Message: 1 of 2

I've learned that I can overlay a contour onto a pcolor by plotting the pcolor first, copying the caxis to a temporary variable, plotting the contour, and then setting caxis back to the saved value.

This, however, always results in the contour being on top of the pcolor (e.g. drak black lines on my pcolor). What I'd _really_ like is to have the pcolor on top of the contour and then set the facealpha of the pcolor so I can see the contour through it. Anyone know how??

Subject: pcolor and contour on same axis

From: Walter Roberson

Date: 8 Aug, 2010 03:28:28

Message: 2 of 2

Chuck37 wrote:
> I've learned that I can overlay a contour onto a pcolor by plotting the
> pcolor first, copying the caxis to a temporary variable, plotting the
> contour, and then setting caxis back to the saved value.
>
> This, however, always results in the contour being on top of the pcolor
> (e.g. drak black lines on my pcolor). What I'd _really_ like is to have
> the pcolor on top of the contour and then set the facealpha of the
> pcolor so I can see the contour through it. Anyone know how??

Use the OpenGL renderer (otherwise you cannot get transparency) and make
sure the pcolor is closer to the user than the contour is -- if you have
graphics and lines in the exact same Z plane for OpenGL then you cannot
control the order they will appear in.

Contours are drawn as patch() objects (lots and lots of them!) so if
necessary you can adjust their Z coordinates after the fact. pcolor does
not inherently like to be taken out of the Z=0 plane, but because pcolor
is really just surf() with a particular viewpoint, you can change the Z
coordinates of the underlying object.

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