Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log scale on pcolor plot with only one tick #8557

Closed
samcunliffe opened this issue May 1, 2017 · 2 comments
Closed

Log scale on pcolor plot with only one tick #8557

samcunliffe opened this issue May 1, 2017 · 2 comments

Comments

@samcunliffe
Copy link

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

@jstrube
Copy link

jstrube commented May 1, 2017

Looks like this is fixed in v2.0.0
plot.pdf

@tacaswell
Copy link
Member

tacaswell commented May 1, 2017

Closing as already fixed. If this is not the case please ping to have this reopened.

[edit] sorry for the noise, defeated by stale browser windows.

@tacaswell tacaswell reopened this May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants