Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Options, e.g. title, thickness, etc for plot3d and parametric_plot3d?

I'm switching from Mathematica to Sage for teaching purposes and am having some difficulty with plot options. Here's an example, in which I create the function f(x,y)=x^2+y^2 and plot the function along with the cross-section curve f(.2,y).

 x,y = var('x,y')
f(x,y) = x^2 + y^2

Surface=plot3d(f(x,y),(x,-1,1),(y,-1,1), frame=True,color='green', opacity=0.1,title='A plot of $f(x,y)$')
x0=.2
Cross_Section=parametric_plot3d((x0,y,f(x0,y)), (y,-1,1), color='red', thickness=5)
Cross_Section+Surface

Questions:

  1. The title does not appear. How can I correct that?
  2. Changing the "thickness" option doesn't appear to have any effect on the cross-section curve.

For 2-dim graphs, I don't seem to encounter problems. To plot a contour diagram for the above function, I entered the following, which worked fine:

C=contour_plot(f,(-1,1),(-1,1),fill=False, cmap='hsv', labels=True,gridlines=True,title='Contour Plot of $f(x,y)=x^2+y^2$')
C.axes_labels(['$x$','$y$'])
C.axes_labels_size(2.5)   
C.fontsize(6)    
C