William Stein wrote:
> On Tue, Oct 13, 2009 at 7:44 PM, Jason Grout
> <[email protected]> wrote:
>> kcrisman wrote:
>>>
>>> On Oct 13, 6:05 pm, "[email protected]" <[email protected]> wrote:
>>>> Hello all, is there any other possibility how to plot implicit
>>>> function than implicitplot?
>>>>
>>>> I do not like implicitplot too much, since it is in fact countourplot
>>>> and it is not easy to set the color (for example).
>>> There is not currently any other way to do this, I think.  A colleague
>>> of mine has some experimental code to implicit plot the "right" way
>>> (by following derivatives around and spot-checking nearby to not miss
>>> components, I guess), but doesn't consider it ready for prime time
>>> yet.
>>
>> How do you do an implicit plot "right"?  Scipy has tools for numerical
>> integration (you mention following derivatives), if that helps.
> 
> I think what the user wants is to be able to *work with* contour plots
> in the same way one can work with normal plots.  E.g., set the color.
> Right now they are always black, right?  Etc.


Nope; but it's a pretty raw wrapper around the matplotlib functionality.

 From the documentation of contour_plot (which is what implicit_plot 
really is):

         - ``cmap`` -- a colormap (default: ``'gray'``), the name of
           a predefined colormap, a list of colors or an instance of a 
matplotlib
           Colormap. Type: ``import matplotlib.cm; 
matplotlib.cm.datad.keys()``
           for available colormap names.



We only have one cryptic example, though:

sage: f(x,y) = x^2 + y^2
sage: contour_plot(f, (-2, 2), (-2, 2), contours=2, cmap=[(1,0,0), 
(0,1,0), (0,0,1)])

A clearer example would be:

sage: contour_plot(f, (-2, 2), (-2, 2), contours=3,fill=False, 
cmap=["red", "green","blue"])


There is no mention of this in implicit_plot docs.  However, here is an 
example:

implicit_plot(x^2+y^2==1, (x,-2, 2), (y,-2, 2), cmap=["red"])

Mathematica doesn't have an implicitplot anymore, deprecating it for 
CountourPlot, which now accepts equations.  That's one way to unify the 
two concepts.

Jason

-- 
Jason Grout


--~--~---------~--~----~------------~-------~--~----~
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-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to