| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| hspace=mpl.rcParams['figure.constrained_layout.hspace']) | ||
| # set anything that was passed in (None will be ignored): | ||
| self.set(w_pad=w_pad, h_pad=h_pad, wspace=wspace, hspace=hspace) | ||
| # see CompressedLayoutEngine below... |
There was a problem hiding this comment.
This comment seems wrong now?
Sorry, something went wrong.
There was a problem hiding this comment.
Ooops, yes, I decided against needing a subclass here.
Sorry, something went wrong.
There was a problem hiding this comment.
Still needs fixing?
Sorry, something went wrong.
| hspace=mpl.rcParams['figure.constrained_layout.hspace']) | ||
| # set anything that was passed in (None will be ignored): | ||
| self.set(w_pad=w_pad, h_pad=h_pad, wspace=wspace, hspace=hspace) | ||
| # see CompressedLayoutEngine below... |
There was a problem hiding this comment.
Still needs fixing?
Sorry, something went wrong.
| fig, axs = plt.subplots(2, 2, figsize=(5, 3), | ||
| sharex=True, sharey=True, layout='compressed') | ||
| for ax in axs.flat: | ||
| ax.imshow(arr) | ||
| fig.suptitle("fixed-aspect plots, layout='compressed'") |
There was a problem hiding this comment.
This seems to look the same as the constrained version?
Sorry, something went wrong.
There was a problem hiding this comment.
but I have no idea what is happening here. This example works fine manually, just using Agg, etc. I'm flummoxed why the sphinx version doesn't work...
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed in newest version - there was some weird interactions between the rcParam and subsequent calls. maybe worth chasing down, but I could not reproduce without sphinx-gallery, so I guess sphinx-galery is using some weird rcParam contexts?
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
I think the context remains the same through a single file.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, but even if I change the rcParam in a normal script, and then specify the kwarg, compress works fine. But in sphinx- gallery it has this weird problem.
Sorry, something went wrong.
| fig, axs = plt.subplots(2, 2, figsize=(5, 3), | ||
| sharex=True, sharey=True, layout='compressed') | ||
| for ax in axs.flat: | ||
| ax.imshow(arr) | ||
| fig.suptitle("fixed-aspect plots, layout='compressed'") |
There was a problem hiding this comment.
I think the context remains the same through a single file.
Sorry, something went wrong.
| A value of 0.2 for a three-column layout would have a space | ||
| of 0.1 of the figure width between each column. | ||
| If h/wspace < h/w_pad, then the pads are used instead. | ||
|
|
There was a problem hiding this comment.
For consistency with above, this empty line should be here (and one added after the rect description) or all above also removed.
Sorry, something went wrong.
There was a problem hiding this comment.
Sure, though this is private, so never rendered in the docs ;-)
Sorry, something went wrong.
Adds compress=True to compressed layout engine. Works for compact axes grids.
|
I've marked merge with single review. This is pretty stand alone, so it shouldn't break anyone. However, happy to get a second review. I'll merge by next Friday if it doesn't attract one. |
Sorry, something went wrong.
|
Thanks everyone for your work on this! |
Sorry, something went wrong.
Thanks for creating this! 😄 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Replaces #20016
We often want a grid of fixed-aspect ratio axes, but constrained_layout and tigt_layout leave large blank spaces between the axes because they only work with the original axes positions, not the aspect-modified versions.
Here I proposed an extension to constrianed_layout that works for simple grids of axes...
Old:
New:
Code
Failures...
This isn't perfect, and that is why it is not in "constrained_layout" Folks should be able to turn this off... This example isn't terrible, but its not very good either, though
Or:
PR Checklist
Tests and Styling
Documentation