how to adjust intensity range in density_plot()

asked 2022-04-16 23:04:06 +0100

user1704042 gravatar image

If I have code such as

var('x,y')
density_plot(0.05*sin(x^2+y^2)^2 + exp(-(x^2+y^2)), (x,-3,3), (y,-3,3), cmap='hot').show(aspect_ratio=1)

and I want to see details at a lower intensity ratio, how do I adjust the intensity range? In matplotlib, this could be done with clim(), but I can't find a similar option for a density_plot() or contour_plot() in SageMath.

edit: I've figured out how to do it with a contour_plot(), specifying the contours:

contour_plot(0.05*sin(x^2+y^2)^2 + exp(-(x^2+y^2)), (x,-3,3), (y,-3,3), 
    cmap='hot', contours=np.linspace(0,0.1,20)).show(aspect_ratio=1)
edit retag flag offensive close merge delete

Comments

A workaround:

cmap='jet'
achrzesz gravatar imageachrzesz ( 2023-07-20 11:04:31 +0100 )edit