Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't know how to comment on another answer, so I'll just post my comment here. You don't have to import matplotlib colormaps, since they are already imported in the sage colormaps object:

sage: var('r v')(r, v)
sage: cmsel = [colormaps['autumn'](i) for i in sxrange(0,1,0.05)]
sage: p = plot3d(0.2*(r**2 + v**2) + cos(2*r)*sin(2*v),(r,-2,2), (v,-2,2), adaptive=True, color=cmsel, plot_points=10, opacity=0.9)
sage: p2 = sphere((0,0,0),1,color='black',opacity=0.5)
sage: (p+p2).show(aspect_ratio=(1,1,1), figsize=[7,3])

You can see the available colormaps by doing

sage: colormaps.keys()

I don't know how to comment on another answer, so I'll just post my comment here. You don't have to import matplotlib colormaps, since they are already imported in the sage colormaps object:

sage: var('r v')(r, v)
v')
sage: cmsel = [colormaps['autumn'](i) for i in sxrange(0,1,0.05)]
sage: p = plot3d(0.2*(r**2 + v**2) + cos(2*r)*sin(2*v),(r,-2,2), (v,-2,2), adaptive=True, color=cmsel, plot_points=10, opacity=0.9)
sage: p2 = sphere((0,0,0),1,color='black',opacity=0.5)
sage: (p+p2).show(aspect_ratio=(1,1,1), figsize=[7,3])

You can see the available colormaps by doing

sage: colormaps.keys()