Skip to content

[BUG] Colorbar label overlap #15

@Cyril-Meyer

Description

@Cyril-Meyer

Label of the colorbar may overlap when small differences in values, e.g. :

Image

Right now, I fixed adding the following code for my usage :

        if colorbar_orientation == "horizontal":
            from matplotlib.ticker import MaxNLocator
            locator = MaxNLocator(nbins=3)
            cbar.ax.xaxis.set_major_locator(locator)

I just override the default locator from Matplotlib, but this probably not the best solution.

After line 595 :

cbar = ax.figure.colorbar(
im, ax=ax, shrink=shrink, orientation=colorbar_orientation
)
cbar.ax.tick_params(labelsize=font_size)
cbar.set_label(label=capitalize_label(_colorbar_value), size=font_size)

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