Skip to content

[BUG] Colorbar label overlap #15

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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