Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea6121d

Browse files
committed
Handle direction="column" in axes_grid.Grid
- fixes #20372 - uniformize docstring of Grid and ImageGrid
1 parent 89ce4fb commit ea6121d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/mpl_toolkits/axes_grid1/axes_grid.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def __init__(self, fig,
9898
If not None, only the first *ngrids* axes in the grid are created.
9999
direction : {"row", "column"}, default: "row"
100100
Whether axes are created in row-major ("row by row") or
101-
column-major order ("column by column").
101+
column-major order ("column by column"). This also affects the
102+
order in which axes are accessed using indexing (``grid[index]``).
102103
axes_pad : float or (float, float), default: 0.02
103104
Padding or (horizontal padding, vertical padding) between axes, in
104105
inches.
@@ -166,7 +167,8 @@ def __init__(self, fig,
166167
sharey = axes_array[row, 0] if share_y else None
167168
axes_array[row, col] = axes_class(
168169
fig, rect, sharex=sharex, sharey=sharey)
169-
self.axes_all = axes_array.ravel().tolist()
170+
self.axes_all = axes_array.ravel(
171+
order="C" if self._direction == "row" else "F").tolist()
170172
self.axes_column = axes_array.T.tolist()
171173
self.axes_row = axes_array.tolist()
172174
self.axes_llc = self.axes_column[0][-1]

0 commit comments

Comments
 (0)