Skip to content

Log Colorbar minorticks_off reverted if ticks set... #13339

Closed
@jklymak

Description

@jklymak

Posted by @LevN0

Apologies if not the right place. This PR has the following side effect:

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.minorticks_off()
cbar.set_ticks([5, 10, 100])

plt.show()

Prior to this PR, minor ticks would remain off after set_ticks when they had been turned off. After this PR, they come back on.

Originally posted by @LevN0 in #12909 (comment)

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