Skip to content

Allow turning off minorticks for Colorbar with LogNorm? #13257

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy