MATLAB Answers


Problem with fsurf (where is the controur?)

Asked by Rene Wells on 17 May 2019
Latest activity Commented on by Walter Roberson
on 18 May 2019
f = @(x,y) (x^0.3)*(y^0.3)
but I do not seem to get the countour below the surface, only the surface. Why?


Sign in to comment.



1 Answer

Answer by Walter Roberson
on 17 May 2019
 Accepted Answer

When I try in R2019a, the contour is there, but you need to rotate the plot to see it as it is underneath the surface.


OK I see what you mean as I rotate with the mouse I can see the contour bel;ow teh surface. Thanks.
But how can I get to see both without rotating, i.e. by creating a gap between the surface and the contour? But how?
surface plots are not compatible with gaps.
You can draw a surface plot and contour3() on top of it. That would require that you create a grid of function values to contour3()
You could fsurf() and set the Alpha (transparency) of it fairly low so that you could see the contour lines underneath.
f = @(x,y) (x.^0.3).*(y.^0.3);
[X,Y] = meshgrid(linspace(0,10));
Z = f(X,Y);
surf(X, Y, Z, 'edgecolor', 'none')
alpha 0.5
hold on
contour(X, Y, Z);
hold off

Sign in to comment.