-
Notifications
You must be signed in to change notification settings - Fork 49
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
jointplot now respects the ratio argument (top plot is larger) with matplotlib backend #682
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm going to rebase this to fix the conflict. |
With this change the sherpa[.astro].ui.plot_fit_resid/delchi routines now display with the top plot being twice the height of the bottom plot when using the matplotlib (pylab) backend. There is no test for this as there is currently no good test suite for the plot contents when a plotting backend is available.
This follows the chips backend for determining the relative height.
It is not obvious whether jointplot is meant to be used with anything but a single column: the chips backend seems to suggest it does, but then only creates a single column anyway, and the matplotlib backend just ignores the number-of-columns argument (at least in set_jointplot). Follow the matplotlib code here.
The Sherpa notebook uses the plot_fit_resid command so was re-run to pick up the updated plot. A link to the read-the-docs Sherpa documentation was added.
DougBurke
force-pushed
the
resize-split-plots
branch
from
October 9, 2019 19:13
7d27022
to
b0894a3
Compare
anetasie
approved these changes
Oct 10, 2019
wmclaugh
reviewed
Oct 10, 2019
Change `pcall` to `call` as noted by @wmclaugh
dtnguyen2
approved these changes
Oct 22, 2019
Marie-Terrell
pushed a commit
that referenced
this pull request
Nov 12, 2019
…op plot is larger) with matplotlib backend jointplot now respects the ratio argument (top plot is larger) with matplotlib backend
DougBurke
added a commit
to DougBurke/sherpa
that referenced
this pull request
Sep 4, 2020
This allows you to say plot_fit_resid(ylog=True) plot_fit_resid(2, overplot=True) The sherpa.plot.JointPlot class has been reworked to explicitly support the overplot option. There is no existing documentation so it's not entirely obvious how the JointPlot and parent SplitPlot class are meant to work, but the tests still pass (and I've added a few to explicitly check the joint-plot case). Note that I have taken the liberty to change the signature of the set_jointplot routine (that is now only defined for matplotlib now that chips has gone away, and wasn't documented). The optional top parameter, which was never set, has been changed to match the numbering scheme of row and column. This routine was fixed in PR sherpa#682 for the Matplotlib backend but at that time it only supported a single column (both before and after sherpa#682 ws fixed), but this has now been fixed (although we have no support for this used with any other column count).
DougBurke
added a commit
to DougBurke/sherpa
that referenced
this pull request
Sep 4, 2020
This allows you to say plot_fit_resid(ylog=True) plot_fit_resid(2, overplot=True) The sherpa.plot.JointPlot class has been reworked to explicitly support the overplot option. There is no existing documentation so it's not entirely obvious how the JointPlot and parent SplitPlot class are meant to work, but the tests still pass (and I've added a few to explicitly check the joint-plot case). Note that I have taken the liberty to change the signature of the set_jointplot routine (that is now only defined for matplotlib now that chips has gone away, and wasn't documented). The optional top parameter, which was never set, has been changed to match the numbering scheme of row and column. This routine was fixed in PR sherpa#682 for the Matplotlib backend but at that time it only supported a single column (both before and after sherpa#682 ws fixed), but this has now been fixed (although we have no support for this used with any other column count).
DougBurke
added a commit
to DougBurke/sherpa
that referenced
this pull request
Oct 3, 2020
This allows you to say plot_fit_resid(ylog=True) plot_fit_resid(2, overplot=True) The sherpa.plot.JointPlot class has been reworked to explicitly support the overplot option. There is no existing documentation so it's not entirely obvious how the JointPlot and parent SplitPlot class are meant to work, but the tests still pass (and I've added a few to explicitly check the joint-plot case). Note that I have taken the liberty to change the signature of the set_jointplot routine (that is now only defined for matplotlib now that chips has gone away, and wasn't documented). The optional top parameter, which was never set, has been changed to match the numbering scheme of row and column. This routine was fixed in PR sherpa#682 for the Matplotlib backend but at that time it only supported a single column (both before and after sherpa#682 ws fixed), but this has now been fixed (although we have no support for this used with any other column count).
DougBurke
added a commit
to DougBurke/sherpa
that referenced
this pull request
Oct 4, 2020
This allows you to say plot_fit_resid(ylog=True) plot_fit_resid(2, overplot=True) The sherpa.plot.JointPlot class has been reworked to explicitly support the overplot option. There is no existing documentation so it's not entirely obvious how the JointPlot and parent SplitPlot class are meant to work, but the tests still pass (and I've added a few to explicitly check the joint-plot case). Note that I have taken the liberty to change the signature of the set_jointplot routine (that is now only defined for matplotlib now that chips has gone away, and wasn't documented). The optional top parameter, which was never set, has been changed to match the numbering scheme of row and column. This routine was fixed in PR sherpa#682 for the Matplotlib backend but at that time it only supported a single column (both before and after sherpa#682 ws fixed), but this has now been fixed (although we have no support for this used with any other column count).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The matplotlib back end now makes the main (top) plot taller than the secondary (bottom) plot when using the sherpa.ui.plot_fit_resid and sherpa.ui.plot_fit_delchi routines (this also holds for the sherpa.astro.ui variants).
Details
With this change the sherpa[.astro].ui.plot_fit_resid/delchi routines now display with the top plot being twice the height of the bottom plot when using the matplotlib (pylab) backend. The code was just not applying the requested
ratio
argument.There is no test for this as there is currently no good test suite for the plot contents when a plotting backend is available.
This is to address #587 and collides with #626 (although easy to address).
An example of what
sherpa.astro.ui.plot_fit_delchi
looks like with this PR (examples from before the change are available in #587):The commits should be squashed into a single commit before merging, but left separated for initial review. There is no documentation on what a "joint plot" is meant to represent, so unclear how to handle the
nrows
andncols
arguments toset_jointplot
.