How to stop extraneous lines when using 'mesh'?

Hi,
I am having problems with the 'mesh' command (see picture below). The command is inserting lines that are not part of the surface under consideration (hyperbolic paraboloid in this case). Is there a way of stopping this happening?
Thanks
Nic
P. S. Interestingly when this is converted to a *.jpeg the extraneous lines disappear.

1 Kommentar

Star Strider
Star Strider am 19 Mär. 2014
Difficult to say without seeing the code you used to generate it.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Mischa Kim
Mischa Kim am 19 Mär. 2014

0 Stimmen

Does this help?
x = -1:0.1:1;
y = -1:0.1:1;
[X,Y] = meshgrid(x,y);
Z = power(Y,2) - power(X,2) - 0.5;
mesh(X,Y,Z)
box

1 Kommentar

OK. Try to see if changing the renderer does the trick:
set(gcf, 'Renderer', 'OpenGL');
or
set(gcf, 'Renderer', 'zbuffer');
Alternatively, check
set(gcf,'EdgeAlpha',0.99)

Melden Sie sich an, um zu kommentieren.

Nic Roberts
Nic Roberts am 19 Mär. 2014
Bearbeitet: Nic Roberts am 19 Mär. 2014

0 Stimmen

No that just puts a box around it, but the extra lines are still there.
The code I used was,
[x,y]=meshgrid(-1:0.1:1);
a=-3;
b=1;
z=0.5*(a*x.^2 + b*y.^2);
mesh(x,y,z);

Produkte

Tags

Gefragt:

am 19 Mär. 2014

Kommentiert:

am 19 Mär. 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by