X Tutup
Skip to content

Log scale on pcolor plot with only one tick #8557

@samcunliffe

Description

@samcunliffe

Bug report

Bug summary

The color scale only has one tickmark. This is never correct.

Code for reproduction

import numpy as np
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm

gcmap = 'plasma'

# random data
mi = 0.00058265
ma = 0.00108149

X, Y = np.meshgrid(range(512), np.linspace(0, 0.3 * 199, 200))
Z = mi+(ma-mi)*np.random.random(X.shape)

# log z axis
plt.pcolor(Z, cmap=gcmap,
           norm=LogNorm(vmin=abs(Z.min()), vmax=abs(Z.max())))
plt.colorbar()
plt.xlim(0, 512)
plt.savefig("plot.pdf")

Actual outcome
plot.pdf

Expected outcome
A colorbar with at least two tickmarks.

Matplotlib version

  • Operating System: Mac OS X 10.12.4
  • Matplotlib Version: 1.5.2
  • Python Version: 3.5.2

installed via pip3, but reproducible on other systems

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup