Closed
Description
Bug report
Bug summary
Axes of mpl_toolkits.axes_grid1.axes_grid.Grid
(and ImageGrid
) are not positioned correctly when direction='column'
. This affects, e.g., the tick labels (see figures).
Code for reproduction
import matplotlib.pyplot as plt
import mpl_toolkits.axes_grid1 as axg1
fig = plt.figure()
g = axg1.Grid(fig, 111, (2, 3), direction='column', axes_pad=0.5)
Obtained appending
import numpy as np
g.axes_all = np.reshape(g.axes_all, g.get_geometry()).ravel(order='F')
g._init_locators()
I believe the culprit is
When direction='column'
, axes_all
are not sorted by creation order; as I think is expected by _init_locators
and as likely indicated by the sentence "This also affects the order in which axes are accessed using indexing" in the description of direction
in the ImageGrid
(but not Grid
) documentation.
Matplotlib version
- Operating system: Debian 10 (on WSL2)
- Matplotlib version: 3.4.2 (conda-forge)
- Matplotlib backend: any
- Python version: 3.9.2 (conda-forge)