Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Something like this:

var('x,y')
cm = colormaps.spring
cf = lambda x,y: (sin(x) + cos(y)) % 1
spherical_plot3d(1,(x,0,4*pi/2),(y,0,pi),color=(cf,cm)).show(aspect_ratio=(1,1,1))

Although the look is not as smooth as one would like.

Something like this:

var('x,y')
cm = colormaps.spring
cf = lambda x,y: (sin(x) + cos(y)) % 1
spherical_plot3d(1,(x,0,4*pi/2),(y,0,pi),color=(cf,cm)).show(aspect_ratio=(1,1,1))

Although the The look is not as smooth as one would like.like with the default number of plot points.

For a smoother look, increase the number of plot points.

sage: cm = colormaps.spring
sage: f = lambda x, y: 1
sage: cf = lambda x, y: (sin(x) + cos(y)) % 1
sage: p = spherical_plot3d(f, (0, 2*RDF.pi()), (0, RDF.pi()), color=(cf, cm), plot_points=200)
sage: p.show(aspect_ratio=1, viewer='threejs')

Higher values of plot_points increase resolution (but also time to display the plot).

Try for example plot_points=400 or even plot_points=800...