Skip to content

[Bug]: "top"-side ImageGrid colorbars draw their ticks on the wrong side #25876

@anntzer

Description

@anntzer

Bug summary

Compare the colorbars at the top of the imagegrid in https://matplotlib.org/3.4.3/gallery/axes_grid1/demo_axes_grid.html and https://matplotlib.org/3.5.3/gallery/axes_grid1/demo_axes_grid.html (same example, but mpl3.4 vs 3.5): the ticks have incorrectly moved from the top side of the colorbar to the bottom side (and the ticklabels are no longer suppressed by the toggle_label(False) call, but that's more or less a consequence of the first point, because toggle_label will try to hide the labels on the cbar_location="top" side).
This is a regression that bisects to #20054.

Code for reproduction

# Run galleries/examples/axes_grid1/demo_axes_grid.py or galleries/examples/axes_grid1/demo_axes_grid2.py

Actual outcome

https://matplotlib.org/3.5.3/gallery/axes_grid1/demo_axes_grid.html

Expected outcome

https://matplotlib.org/3.4.3/gallery/axes_grid1/demo_axes_grid.html

Additional information

Obviously #20054 changed colorbar axes for the (much) better. We can either try to fix the problematic interaction between new-style colorbars and ImageGrid, or "advantageously" interpret the fact that no one reported this bug in the ~1.5y since the release of matplotlib 3.5 as a sign that ImageGrid sees very little use and perhaps deprecate it (it has a slightly idiosyncratic API anyways, and may be better replaced by compressed layout these days).

Operating system

macos

Matplotlib Version

3.8.0.dev1020+gefd66d48fc

Matplotlib Backend

mplcairo

Python version

3.11

Jupyter version

enosuchlib

Installation

git checkout

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions