Rename Plot.configure -> Plot.layout, add Plot.share, and modify Plot.layout parameters #2954
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.
A few important API changes here:
Plot.configure
has been renamed toPlot.layout
. It's shorter and better focused on what this method is about.sharex
/sharey
parameters have moved out of this method and into a newPlot.share
method. I expect that this method will eventually generalize to other variables (i.e., allowing different color scales in subplots), but that's currently blocked on having a better story for legend configuration.figsize
parameter inPlot.configure
/Plot.layout
has been shortened to justsize
.algo
parameter has been added toPlot.layout
, accepting"tight"
,"constrained"
, orNone
.This PR has an additional tweak to fact that legends are currently not visible in an interactive pyplot window. When calling
Plot.show
, the legend will be right-aligned with the edge of the subplots, rather than left-aligned with it. This means that it will overlap the figure content, which is regrettable, but I don't know of a better non-hacky solution until matplotlib's layout algorithms understand figure legends.When calling
Plot.save
, it is currently necessary to manually specifybbox_inches="tight"
if you have a legend.I expect that some of these decisions are temporary. In particular:
Plot.layout
for additional customization, but am not certain about the best API yet.