Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contour_plot defaults changed to fill, affects implicit_plot #4462

Closed
johnperry-math opened this issue Nov 7, 2008 · 8 comments
Closed

contour_plot defaults changed to fill, affects implicit_plot #4462

johnperry-math opened this issue Nov 7, 2008 · 8 comments

Comments

@johnperry-math
Copy link

In Sage 3.1.1,

implicit_plot(x^2+y^2-1,(x,-1.1,1.1),(y,-1.1,1.1),plot_points=100).show(aspect_ratio=1)

produces a very nice circle.

In Sage 3.1.4, the same code produces a filled-in disc. Likewise, implicit_plot tries to fill in all curves;

implicit_plot(5*x^4-x^2-y^2,(x,-5,5),(y,-5,5))

looks odd.

The cause is contour_plot (called by implicit_plot): the default for the fill option is True. Feeding fill=False to implicit_plot produces the desired behavior:

implicit_plot(x^2+y^2-1,(x,-1.1,1.1),(y,-1.1,1.1),plot_points=100,fill=False).show(aspect_ratio=1)

Component: graphics

Issue created by migration from https://trac.sagemath.org/ticket/4462

@johnperry-math
Copy link
Author

Attachment: circle_sage3.1.1.png

result of implicit_plot in sage 3.1.1

@johnperry-math
Copy link
Author

result of implicit_plot in sage 3.1.4

@johnperry-math
Copy link
Author

comment:1

Attachment: circle_sage3.1.4.png

The fix is easy: change line 2926 of site-packages/sage/plot/plot.py, which currently reads

@options(contours=(0,0))

to

@options(contours=(0,0),fill=False)

@jasongrout
Copy link
Member

comment:2

It looks like #4201 forgot to override that option of contour plot. That's where the change was made.

I refereed that patch; my bad.

@jasongrout
Copy link
Member

comment:3

Attachment: implicit-plot-no-fill.patch.gz

@jasongrout
Copy link
Member

comment:4

John Perry should also receive credit for the patch, since he gave the actual fix in his comment. I added documentation as well.

@mwhansen
Copy link
Contributor

mwhansen commented Nov 8, 2008

comment:5

Looks good.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 8, 2008

comment:6

Merged implicit-plot-no-fill.patch in Sage 3.2.rc0

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Nov 8, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-3.2 milestone Nov 8, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants