Opened 13 years ago

Closed 13 years ago

#4462 closed defect (fixed)

[with patch, positive review] contour_plot defaults changed to fill, affects implicit_plot

Reported by: john_perry Owned by: was
Priority: minor Milestone: sage-3.2
Component: graphics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

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)

Attachments (3)

circle_sage3.1.1.png (30.3 KB) - added by john_perry 13 years ago.
result of implicit_plot in sage 3.1.1
circle_sage3.1.4.png (23.8 KB) - added by john_perry 13 years ago.
result of implicit_plot in sage 3.1.4
implicit-plot-no-fill.patch (1.0 KB) - added by jason 13 years ago.

Download all attachments as: .zip

Change History (9)

Changed 13 years ago by john_perry

result of implicit_plot in sage 3.1.1

Changed 13 years ago by john_perry

result of implicit_plot in sage 3.1.4

comment:1 Changed 13 years ago by john_perry

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)

comment:2 Changed 13 years ago by jason

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.

Changed 13 years ago by jason

comment:3 Changed 13 years ago by jason

  • Summary changed from contour_plot defaults changed to fill, affects implicit_plot to [with patch, needs review] contour_plot defaults changed to fill, affects implicit_plot

comment:4 Changed 13 years ago by jason

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

comment:5 Changed 13 years ago by mhansen

  • Summary changed from [with patch, needs review] contour_plot defaults changed to fill, affects implicit_plot to [with patch, positive review] contour_plot defaults changed to fill, affects implicit_plot

Looks good.

comment:6 Changed 13 years ago by mabshoff

  • Milestone set to sage-3.2
  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.