Ask Your Question

Vertical view plot3d

asked 2017-02-10 18:23:51 -0500

Sol401 gravatar image

Is there any way to set the vertical view in plot3d? For example I want to plot sqrt(x^2+ y^2). I know how to set the x and y ranges but I only want the z axis to go from say 0 to 3. Zmin and zmax do not seem to do anything.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-02-10 22:34:56 -0500

updated 2017-02-11 17:59:22 -0500

Since the surface is determined by the independent variables, you can limit their domains to limit the height of the surface:

var('x y z')
limit = sqrt(9/2)
plot3d(sqrt(x^2+ y^2), (x,-limit,limit), (y,-limit,limit))

Here's a live example.

And if you want to set limits for each variable independently, use implicit_plot3d:

var('x y z')
implicit_plot3d(sqrt(x^2+ y^2)-z, (x,-5,5), (y,-5,5), (z,0,3))

Another live example.

edit flag offensive delete link more


Thanks for your reply! However, not quite what I'm looking for. Unfortunately I now realize that I was not very clear in my question! Basically I want that figure to look exactly like what it's supposed to look like (i.e., a cone). I can see that the cone is there, but when I'm teaching this stuff to students who have never seen it before, they're going to look at that figure and say "that's not a cone" due to the top "curves". So, I want to actually have the independent variables generate larger values of Z than the values of Z that I show (basically, I want to chop the top part of that view so that it now actually does look like a standard cone). Is there a way to do this?

Sol401 gravatar imageSol401 ( 2017-02-11 11:10:34 -0500 )edit

How about the added second option?

paulmasson gravatar imagepaulmasson ( 2017-02-11 17:58:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2017-02-10 18:20:49 -0500

Seen: 27 times

Last updated: Feb 11