8000 issue with colorbar using LogNorm and extend='min' · Issue #5201 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
issue with colorbar using LogNorm and extend='min' #5201
Closed
@jpmattern

Description

@jpmattern

I often create log-scaled pcolormesh plots on my (university) computer and frequently encounter an issue: whenever I plot a colorbar using extend='both' or extend='min' and a LogNorm with vmin < 1.0, the bottom triangle of the colorbar stays white, no matter what colormap I use.

Here is a piece of code that recreates the problem and also shows an example where the colorbar looks like it should (the difference is that vmin >= 1.0).

import matplotlib as mpl
import matplotlib.pyplot as plt

norm0 = mpl.colors.LogNorm(vmin=1.0, vmax=1000.0)
norm1 = mpl.colors.LogNorm(vmin=0.1, vmax=1000.0)

fig, axs = plt.subplots(1,2)

# no problem here
mpl.colorbar.ColorbarBase(axs[0], norm=norm0, orientation='vertical', extend='both')
# bottom triangle section of color bar stays white
mpl.colorbar.ColorbarBase(axs[1], norm=norm1, orientation='vertical', extend='both')

plt.show()

matplotlib_logcolorbar

I am using matplotlib version 1.2.1 (and I have also recreated the problem in 1.3.1). If this apparent bug has been fixed in later versions, is there an easy workaround to fill the triangle? Unfortunately I cannot easily update the software on university computers.

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