Ask Your Question

how do i plot a parabola in the x=2 plane?

asked 2020-02-04 16:19:29 -0500

updated 2020-02-04 16:42:00 -0500

vdelecroix gravatar image

I apologize, for I am very new to sage. Here is what I input; the error was that y was not defined.

P=implicit_plot3d(lambda x,y,z:x-2,(-2,2),(-2,2),(-2,8))
edit retag flag offensive close merge delete


You can use var('y') to define y as a variable, and similarly for z.

John Palmieri gravatar imageJohn Palmieri ( 2020-02-04 18:28:50 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2020-02-04 19:41:51 -0500

dazedANDconfused gravatar image

To get your plot using the parametric_plot3d command that vdelecroix suggested, you could try:

u = var('u')

The result, running in a SageCellServer is shown: image description

edit flag offensive delete link more


Note that the command var('u') defines u: you should be able to use var('u') rather than u = var('u'). Unfortunately many of the examples in the Sage documentation needlessly use the longer version.

John Palmieri gravatar imageJohn Palmieri ( 2020-02-05 00:47:36 -0500 )edit

Good point. It's a habit I struggle to break.

dazedANDconfused gravatar imagedazedANDconfused ( 2020-02-05 13:11:18 -0500 )edit

answered 2020-02-04 16:46:05 -0500

vdelecroix gravatar image

First of all, P is in itself a graphics object. Writing plot3d(P) does not make much sense.

Secondly, f is a one-variable function so that plot(f) is a 2 dimensional picture (that works). But then the addition plot(f)+plot3d(P) is trying to concatenate a 2-dimensional and a 3-dimensional picture that looks weird.

Now, to draw a curve in 3d you can for example use parametric_plot3d.

edit flag offensive delete link more

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: 2020-02-04 16:19:29 -0500

Seen: 549 times

Last updated: Feb 04