id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
1862,"[with patch, positive review] implement at least some sort of useful rudimentary implicit 2d plotting function",was,was,"{{{
On Jan 19, 2008 12:44 AM, Dagda <> wrote:
>
> Hi,
> I was wondering if there was a way to plot relations implicitly, in 2D
> and/or 3D. A simple example would be to plot a circle with something
> like the following:
>
> plot_implicit(x^2+y^2=1)
Here's how do this sort of thing using contour_plot in sage right now.
(Note -- for efficiency reasons, you definitely want to only plot a Python
function -- i.e., lambda -- at present. This will change soon.)
First, define this function in Sage:
def implicit_plot(f, x_range, y_range, plot_points=100):
return contour_plot(f, x_range, y_range, fill=False, contours=1, plot_points=plot_points)
Then use it:
sage: implicit_plot(lambda x,y: x^2 + y^2 - 1, (-2,2), (-2,2))
sage: implicit_plot(lambda x,y: x^3 + x*y^2 - 1, (-2,2), (-2,2))
sage: implicit_plot(lambda x,y: (x-y^2)*(y-x^3), (-2,2), (-2,2))
The input should be a function f of two variables, and implicit_plot as I've
defined it above graphs f(x,y) == 0 in the given region.
This could be turned into a first version of a genuine implicit plot at some point.
Josh Kantor is also looking into some other more sophisticated related
approaches. It would be good to understand precisely how Sage's
contour_plot function works (it builds mostly on matplotlib's functions)....
William
}}}",defect,closed,major,sage-2.10.4,graphics,fixed,,harald.schilly@…,,,,,,,,,