8000 Allow turning off minorticks for Colorbar with LogNorm? · Issue #13257 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Allow turning off minorticks for Colorbar with LogNorm? #13257
Closed
@LevN0

Description

@LevN0

Summary

MPL 3 introduces minorticks on Colorbar. These are enabled by default for LogNorm.

If the user sets custom tick marks for LogNorm, the minor ticks become confusing in my opinion.

Example

fig, ax = plt.subplots()

data = np.clip(randn(250, 250)*1000, 0, 1000)

cax = ax.imshow(data, norm=mpl.colors.LogNorm(vmin=1, vmax=1000))
cbar = fig.colorbar(cax, format='%d')
cbar.set_ticks([5, 50, 500])

Which produces,

mpl3_lognorm

Discussion

There is already the method Colorbar.minorticks_off, however it has a check that if the axis is log, then do nothing.

Request

The minor tickmarks add confusion here in my opinion. Can we have the option to turn them off via the existing Colorbar.minorticks_off?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0