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:
surf and mesh in new figure

Subject: surf and mesh in new figure

From: Sargondjani

Date: 26 Jan, 2012 15:30:14

Message: 1 of 3

hi,

im always struggling with surf (or mesh) plots. with normal plots i do:

figure
plot(x1,y1)

figure
plot(x2,y2)

and i get two figures (perfect!). but if i do:
figure
surf(x1,y1,z1)

figure
surf(x2,y2,z2)

the second surface plot 'overwrites' the first one (and the same happens with mesh(x,y,z)).
why/how is surf different from normal plot?
and how should i solve this?

Subject: surf and mesh in new figure

From: dpb

Date: 26 Jan, 2012 15:59:45

Message: 2 of 3

On 1/26/2012 9:30 AM, Sargondjani wrote:
> hi,
>
> im always struggling with surf (or mesh) plots. with normal plots i do:
>
> figure
> plot(x1,y1)
>
> figure
> plot(x2,y2)
>
> and i get two figures (perfect!). but if i do:
> figure
> surf(x1,y1,z1)
>
> figure
> surf(x2,y2,z2)
>
> the second surface plot 'overwrites' the first one (and the same happens
> with mesh(x,y,z)). why/how is surf different from normal plot? and how
> should i solve this?

What does

gcf

return? 2 after the second call, I presume?

Not sure why, but surf and mesh use low level calls only and begin w/ a
call new the function newplot() which may be behaving badly is my
conjecture...

The sequence performs as expected here w/ an earlier release (R12) so
I'd submit an official query to TMW as to why/when behavior actually
changed.

--

Subject: surf and mesh in new figure

From: Sargondjani

Date: 31 Jan, 2012 17:44:09

Message: 3 of 3

thanks for your help! actually it turns out the problem is my computer!!

if the figure windows open, there is no figure visible, but if i put it on full screen then the plot/surf becomes visible...

very strange and i suspect it has something to do with samsung... every samsung product i know has some weird glitches...

Tags for 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