#4878: [with patch; needs review] Add a density_plot() function
-----------------------+----------------------------------------------------
Reporter: abergeron | Owner: abergeron
Type: defect | Status: new
Priority: major | Milestone: sage-3.4
Component: graphics | Resolution:
Keywords: |
-----------------------+----------------------------------------------------
Comment (by wdj):
Applies to 3.2.2 cleanly and passes sage -t. The docstrings look fine.
I tried
{{{
sage: density_plot(sin(x^2 + y^2)*cos(x)*sin(y), (-4, 4), (-4, 4),
cmap='winter', plot_points=100)
sage: contour_plot(sin(x^2 + y^2)*cos(x)*sin(y), (-4, 4), (-4, 4),
cmap='winter', plot_points=100, contours=40)
}}}
and noticed that they look very similar (modulo scaling). However, there
are some plotting artifacts contour_plot leaves at the "corners" where
cos(x)=0 and sin(y)=0. density_plot seems to avoid these problems. Nice
patch.
BTW, where can one find the list of "legal" values of cmap? For example,
_allowed_options gives this:
{{{
cmap The colormap, one of (autumn, bone, cool, copper,
gray, hot, hsv, jet, pink, prism, spring, summer,
winter)
}}}
But this is incomplete, since Oranges, Blues, etc also work. For example,
try
{{{
sage: x,y = var('x,y')
sage: density_plot(sin(x^2 + y^2)*exp((x^2+y^2)/10), (-4, 4), (-4, 4),
cmap='Greens')
}}}
I'm happy giving this a positive review but am wondering about this one
small issue with the output of _allowed_options. Can the author please
comment on this?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4878#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---