Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

New colorbar doesn't handle norms without a scale properly... #20324

Copy link
Copy link
Closed
@jklymak

Description

@jklymak
Issue body actions

As reported at astropy by @dstansby: (astropy/astropy#11800) colorbars with norms that do not have a scale associated with them are not being ticked properly.

import matplotlib.pyplot as plt 
import numpy as np
import matplotlib.colors as mcolors

fig, ax = plt.subplots()

pc = ax.imshow(np.arange(100).reshape(10, 10), norm=mcolors.TwoSlopeNorm(20, 0, 100), cmap='RdBu_r')

cb = fig.colorbar(pc, extend='both')
plt.show()

3.4.2 (correct)

olddd

Master (incorrect)

newww

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.topic: color/colorbar

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.