You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been a while, but I'm looking to try starting to use the declarative interface in my own work. One major sticking point that came up right away is how multi-panel figures are handled. Right now, it looks like only regular, even grids of panels/axes are supported by using the layout 3-tuple in each panel (so that they are added as subplots) and listing all the panels sequentially to the PanelContainer.
I use GridSpec a lot, so it would be nice to at least be able to set layout to be a SubplotSpec. However, seeing matplotlib's recent addition of subplot_mosaic makes me think that there could be an even more streamlined way to support complex figure layouts in the declarative interface. For example, if panels could be generalized from just being a list of panels, I could see something like the following:
by using the nested list interface. Though, having main_panel show up twice to mean "this panel covers both these spaces" rather than "copy this panel in both these spaces" may not be intuitive for all users, so perhaps an alternate API for specifying this may be needed. Also, not sure what the string short-hand interface, or specifying the extra kwargs to subplot_mosaic would look like either.
In going back through the issue tracker, a similar (but perhaps more simplified, focusing on just regular even grids) concern was brought up in #1016 (comment):
Layout of plots does not work as one might initially expect. Currently we set the layout attribute on a panel with a tuple of the location as in matplotlib. (1, 2, 2) While that behavior is fine, when adding panels to the panel container we just pass a simple list. It would be desirable to have the capability to not set the layout attribute and determine the layout by passing a list of lists. For example to layout a 2x2 figure it would be pc.panels = [[p1, p2], [p3, p4]].
Just wanted to point out this complex layout I was able to achieve with the SkewT in MetPy, in case it's a useful example for further development or your work:
It's been a while, but I'm looking to try starting to use the declarative interface in my own work. One major sticking point that came up right away is how multi-panel figures are handled. Right now, it looks like only regular, even grids of panels/axes are supported by using the layout 3-tuple in each panel (so that they are added as subplots) and listing all the panels sequentially to the
PanelContainer
.I use GridSpec a lot, so it would be nice to at least be able to set
layout
to be aSubplotSpec
. However, seeing matplotlib's recent addition ofsubplot_mosaic
makes me think that there could be an even more streamlined way to support complex figure layouts in the declarative interface. For example, ifpanels
could be generalized from just being a list of panels, I could see something like the following:by using the nested list interface. Though, having
main_panel
show up twice to mean "this panel covers both these spaces" rather than "copy this panel in both these spaces" may not be intuitive for all users, so perhaps an alternate API for specifying this may be needed. Also, not sure what the string short-hand interface, or specifying the extra kwargs tosubplot_mosaic
would look like either.In case a motivating example is desired, see https://unidata.github.io/MetPy/latest/examples/plots/Skew-T_Layout.html.
The text was updated successfully, but these errors were encountered: