Ticket #9199 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

plot(..., fill=False) still turns on filling

Reported by: jason Owned by: jason, was
Priority: major Milestone: sage-4.6
Component: graphics Keywords: beginner
Cc: kcrisman Work issues:
Report Upstream: N/A Reviewers: Jason Grout
Authors: Ryan Grout Merged in: sage-4.6.alpha1
Dependencies: Stopgaps:

Description

Try plot(x^2,(x,-1,1), fill=False).

Attachments

trac_9199_plot_fill.patch Download (2.0 KB) - added by ryan 3 years ago.
make "fill=False" work.
trac_9199_plot_fill.2.patch Download (2.7 KB) - added by ryan 3 years ago.
update: fill=None works too!
trac_9199_plot_fill-rebased.patch Download (2.0 KB) - added by jason 3 years ago.
Rebased to 4.5.2; apply only this patch
trac_9199_plot_fill.3.patch Download (1.8 KB) - added by ryan 3 years ago.
Updated patch (with Sage 4.5.3)

Change History

comment:1 Changed 3 years ago by kcrisman

  • Keywords beginner added

Right, because fill=None is the current default. This should be very easy to fix.

Changed 3 years ago by ryan

make "fill=False" work.

comment:2 Changed 3 years ago by ryan

  • Status changed from new to needs_work

here is the patch that fixes the fill=False issue. It breaks fill=None (however, fill=None isn't really that natural).

Interesting issue...when running the doctests for this patch, the doctest timed out and then crashed.


Trying: plot(xInteger(3),(x,Integer(1),Integer(2))) # this one does not###line 2276:_sage_ >>> plot(x3,(x,1,2)) # this one does not Expecting nothing * * Error: TIMED OUT! PROCESS KILLED! * * * * Error: TIMED OUT! * * [361.7 s]


when plotting this in sagenb, it works fine.

comment:3 Changed 3 years ago by ryan

Oops, here it is with better formatting.

---------------------------------------
Trying:
plot(x**Integer(3),(x,Integer(1),Integer(2))) # this one does not###line
2276:_sage_ >>> plot(x^3,(x,1,2)) # this one does not
Expecting nothing
*** *** Error: TIMED OUT! PROCESS KILLED! *** ***
*** *** Error: TIMED OUT! *** ***
[361.7 s]
--------------------------------------- 

comment:4 Changed 3 years ago by kcrisman

This could come from the change somehow.

More important is whether anyone relies somewhere else in the code on fill=None as working. There should be a way to handle both of these - catch fill=False and then rename fill to None, for instance. What do you think?

comment:5 Changed 3 years ago by ryan

well...about sage -t. Every doctest I run crashes (they all time out and then crash at about 360 seconds). It even crashes with my sage-main branch (which is my clean sage 4.5.1). It's strange because with my last patch, the doctests work fine. I'll try undoing the changes and see it changes anything.

As far as handling fill both False and None, not anything big. just need to change

if fill is not False:

to

if fill is not False and fill is not None:

I originally had it the second way, but I removed in the hopes that it would fix the doctest crashes (it didn't).

I'll add it back as soon as I get back to my sage computer.

Changed 3 years ago by ryan

update: fill=None works too!

comment:6 Changed 3 years ago by ryan

  • Status changed from needs_work to needs_review

comment:7 Changed 3 years ago by jason

How did you get that second patch (i.e., how did you generated whatever you posted as the patch)? It seems to be two patches concatenated together. When I apply it, I don't get the "fill=None works again" behavior or piece of code.

Changed 3 years ago by jason

Rebased to 4.5.2; apply only this patch

comment:8 follow-up: ↓ 9 Changed 3 years ago by jason

  • Status changed from needs_review to needs_work

I rebased your patch (your patch had the default color to be rgbcolor=(0,0,0) for some reason), and combined your two patches into one patch. However, when I do:

plot(x^2,(x,-1,1), fill=None)

I get filling (where I didn't before the patch).

Changed 3 years ago by ryan

Updated patch (with Sage 4.5.3)

comment:9 in reply to: ↑ 8 Changed 3 years ago by ryan

Replying to jason:

I rebased your patch (your patch had the default color to be rgbcolor=(0,0,0) for some reason), and combined your two patches into one patch. However, when I do:

plot(x^2,(x,-1,1), fill=None)

I get filling (where I didn't before the patch).

Updated patch should fix this.

comment:10 Changed 3 years ago by ryan

  • Status changed from needs_work to needs_review

comment:11 Changed 3 years ago by jason

  • Status changed from needs_review to positive_review
  • Reviewers set to Jason Grout
  • Authors set to Ryan Grout

Looks good! Thanks!

Apply only trac_9199_plot_fill.3.patch

Karl-Dieter: if you reviewed this patch too, add your name to the list.

comment:12 Changed 3 years ago by jason

Note that this is Ryan's first contribution (along with #8838 and #7154)

comment:13 Changed 3 years ago by mpatel

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.6.alpha1
Note: See TracTickets for help on using tickets.