#5651 closed defect (fixed)
[with patch, positive review] make it so plot(...) passes extra options to show (maybe only those that makes sense)
Reported by: | was | Owned by: | wcauchois |
---|---|---|---|
Priority: | major | Milestone: | sage-4.1.1 |
Component: | graphics | Keywords: | |
Cc: | wcauchois, was, jason | Merged in: | sage-4.1.1.alpha0 |
Authors: | Bill Cauchois | Reviewers: | William Stein, Jason Grout |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
This works now:
plot(sin(x^2),(x,-3,3)).show(figsize=[8,2])
This would be nice:
plot(sin(x^2),(x,-3,3),figsize=[2,8])
The analogue of the above works systematically everywhere for 3d plotting.
Attachments (2)
Change History (20)
comment:1 Changed 14 years ago by
Summary: | make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
comment:2 Changed 14 years ago by
Summary: | [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, needs work] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
comment:3 Changed 14 years ago by
Summary: | [with patch, needs work] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
Now it works for everything, ever!! With doctests too.
comment:4 Changed 14 years ago by
Summary: | [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, needs work] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
Positive review modulo making so consistent with 3d plotting:
sphere((0,0,0),1, aspect_ratio=[1,4,7]) + sphere((1,1,1),1, aspect_ratio=[1,1,1])
Note that it is the *rightmost* thing that has precedence. Otherwise positive review.
Changed 14 years ago by
Attachment: | trac5651.patch added |
---|
comment:6 Changed 14 years ago by
Summary: | [with patch, needs work] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, positive review] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
comment:7 Changed 14 years ago by
Summary: | [with patch, positive review] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, positive review, needs rebase] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
This one needs to be rebased due to a doctest merge conflict in arrow.py. On top of that: this is a diff, so please make sure you post a proper patch this time.
mabshoff@sage:/scratch/mabshoff/sage-4.0.alpha0/devel/sage$ patch -p1 --dry-run < trac_5651.patch patching file sage/plot/arrow.py Hunk #1 FAILED at 310. 1 out of 1 hunk FAILED -- saving rejects to file sage/plot/arrow.py.rej patching file sage/plot/bar_chart.py patching file sage/plot/bezier_path.py <SNIP>
Note that various doctest patches in plot/* are going into 4.0.alpha0, so please rebase post 4.0.a0.
Cheers,
Michael
comment:8 Changed 14 years ago by
comment:9 Changed 14 years ago by
Summary: | [with patch, positive review, needs rebase] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
I rebased the patch on Sage 4.0.rc0. As far as I could tell, the doctest failures I encountered were not related to this patch. My apologies for posting a diff beforehand, I'm still learning the idiosyncracies of Mercurial Queues :).
comment:10 Changed 14 years ago by
Cc: | jason added |
---|
comment:11 Changed 14 years ago by
Summary: | [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, positive review] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
comment:12 Changed 14 years ago by
Summary: | [with patch, positive review] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, needs rebase] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
Hi Bill,
I tried applying this to 4.0 and got a bunch of failures. I can probably rebase it later this evening.
comment:14 Changed 14 years ago by
Summary: | [with patch, needs rebase] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
---|
I added a new rebase, so if someone could review this then we can finally get this functionality into Sage.
I feel like I did a little bit of a dirty thing with the new linkmode parameter, which was added somewhere along the line. linkmode is intended to be consumed by show() before the keywords are passed onto save(), so I just popped it from the keyword dict at the beginning of the function.
Changed 14 years ago by
Attachment: | trac5651-rebase.patch added |
---|
based on sage 4.1.alpha2 (fixed, whoops)
comment:15 Changed 14 years ago by
Reviewers: | → William Stein, Jason Grout, |
---|---|
Summary: | [with patch, needs review] make it so plot(...) passes extra options to show (maybe only those that makes sense) → [with patch, positive review] make it so plot(...) passes extra options to show (maybe only those that makes sense) |
The rebased patch applies fine to my 4.1 tree. I tried a few examples and ran the doctests in plot/*.py[x] and plot/plot3d/*.py[x] and everything seems fine. I'm giving a positive review to the rebasing. That combined with William's almost positive review above adds up to a positive review.
I also looked at the code and it looked reasonable.
Thanks and good work!
comment:16 Changed 14 years ago by
Authors: | → Bill Cauchois |
---|---|
Merged in: | → sage-4.1.1.alpha0 |
Resolution: | → fixed |
Status: | new → closed |
Merged trac5651-rebase.patch
. That rebased patch contains doctrings that doesn't conform with conventions for formatting docstrings. In particular, in sage/plot/bar_chart.py
:
131 Extra options will get passed on to show(), as long as they are valid:
In sage/plot/bezier_path.py
:
171 Extra options will get passed on to show(), as long as they are valid:
In sage/plot/matrix_plot.py
:
58 Extra options will get passed on to show(), as long as they are valid: 62 Extra options will get passed on to show(), as long as they are valid:
In sage/plot/polygon.py
:
255 Extra options will get passed on to show(), as long as they are valid:
These issues should be addressed in another enhancement ticket.
comment:18 Changed 14 years ago by
Reviewers: | William Stein, Jason Grout, → William Stein, Jason Grout |
---|
This is really awesome. However, things like this should work too:
Also, this should have gridlines:
Clarify the comment
}}}