Skip to content

Add colorbar that span multiple columns at a specified row in GridSpec #392

@Holmgren825

Description

@Holmgren825

Hey!

Not sure if this is my own lack of understanding or currently not possible. But I'm wondering if it is possible to add a colobar that spans multiple columns at a specific row in a grid? Using matplotlib we can do something like this

fig, axs = plt.subplots(nrows=2, ncols=2)
rng = np.random.default_rng()
data = rng.random((100, 100))
cm = axs[0, 0].pcolormesh(data)
fig.colorbar(cm, ax=axs[0, :], location="bottom")

and get

Image

while trying something similar in ultraplot

fig, axs = uplt.subplots(nrows=2, ncols=2)
rng = np.random.default_rng()
data = rng.random((100, 100))
cm = axs[0, 0].pcolormesh(data)
fig.colorbar(cm, ax=axs[0, :], location="bottom")

gives

Image

I think this would be helpful when sharing colormaps among columns, but not rows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions