8000 Incorrect placement of Colorbar ticks using LogNorm · Issue #12155 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Incorrect placement of Colorbar ticks using LogNorm #12155
Closed
@rayosborn

Description

@rayosborn

Bug report

Bug summary

After upgrading to Matplotlib v3.0.0, the tick marks on the colorbar are no longer placed correctly when using a matplotlib.colors.LogNorm normalization.

Code for reproduction

The code is embedded in a class defined within the NeXpy application, but uses standard Matplotlib function calls. Here are the relevant extracted lines:

from matplotlib.colors import LogNorm, Normalize, SymLogNorm
from matplotlib.ticker import AutoLocator, LogLocator, ScalarFormatter
from matplotlib.ticker import LogFormatterSciNotation as LogFormatter
        self.norm = LogNorm(self.vaxis.lo, self.vaxis.hi)
        self.locator = LogLocator()
        self.formatter = LogFormatter()
        self.image = ax.pcolormesh(x, y, self.v, cmap=self.cmap, **opts)
        self.image.set_norm(self.norm)
        self.colorbar = self.figure.colorbar(self.image, ax=ax, norm=self.norm)
        self.colorbar.locator = self.locator
        self.colorbar.formatter = self.formatter
        self.colorbar.update_normal(self.image)

Actual outcome

In Matplotlib v3.0.0, I get:
matplotlib_3_0_0

Expected outcome

In Matplotlib v2.2.3, I get:
matplotlib_2_2_3

Matplotlib version

  • Operating system: Mac OS 10.12.6
  • Matplotlib version: 3.0.0
  • Matplotlib backend: Qt5Agg
  • Python version: 3.6.5

I got the same result when using conda to install v3.0.0 or pip to install the latest development version.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0