Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Description
Summary
The current interface is neither very intuitive nor practical nor in line with the traditional gridspec logic.
Proposed fix
Half a note to self, because this is not completely thought through:
- The parameter
ngrids
seems not to be working (usage raises) - The attributes
ngrids
is not helpful. It's misnomed (naxes would be better), and it's equivalent tolen(grid)
orlen(grid.axes_all)
. - Not sure what we need
grid.axes_llc
for. That seems quite specific. - The 2D grid arrangement
axes_row
,axes_column
are lists of lists. In contrastsubplots
returns an array. Thus, you need double indexinggrid.axes_row[row][col}
and cannot use the multi-indexaxs[row, col]
. - Having the
direction
parameter andgrid.axes_row
,grid.axes_column
is basically two redundant approaches towards ordering.
Possible improvements:
deprecate- replaced byFix ngrids support in axes_grid.Grid(). #27972ngrids
attribute- add an attribute
grid.axes
or maybe evengrid.axs
(in analogy tofig, axs = plt.subplots(2, 3)
), which is a ndarray of the Axes. Hence one could dogrid.axs[row, column]
. - maybe (??) soft-deprecate axes_all, axes_row, axes_col, direction?
- in
Grid.__init__
make everything afternrows_ncols
kw-only - would be nice to have a default
rect
, but that requires reorganizing parameter order because that's beforenrows_ncols
.
Might be possible migratetodef __init__(self, fig, rect, nrows_ncols, *, ...)
with reasonable deprecation warnings and catching inappropriate use. - But would have to think this throughdef __init__(self, nrows_ncols, *, rect, ...)