Closed
Description
Bug report
Bug summary
When using colorbar with imshow(image, norm=LogNorm()), the produced colorbar automatically adds minorticks, and cannot be turned off with cbar.ax.minorticks_off(). Also the font of the tick label is not the same as the font set in matplotlibrc.
Code for reproduction
# This is modified from an example in matplotlib gallery.
import matplotlib.pyplot as plt
import numpy as np
from numpy import ma
from matplotlib import colors, ticker, cm
from matplotlib.mlab import bivariate_normal
N = 100
x = np.linspace(-3.0, 3.0, N)
y = np.linspace(-2.0, 2.0, N)
X, Y = np.meshgrid(x, y)
z = (bivariate_normal(X, Y, 0.1, 0.2, 1.0, 1.0)
+ 0.1 * bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0))
z = ma.masked_where(z <= 0, z)
fig, ax = plt.subplots()
from matplotlib.colors import LogNorm
cs = ax.imshow(z,norm=LogNorm())
cbar = fig.colorbar(cs)
cbar.ax.minorticks_off()
plt.show()
Actual outcome
Expected outcome
I would expect the colorbar to not have minorticks and to use the same font as other tick labels (I set font to be Arial in matplotlibrc).
Matplotlib version
- Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)
2.0.0_1, OSX
- How did you install Matplotlib and Python (pip, anaconda, from source ...)
Macports
Edit by @afvincent: removed the unnecessary instructions coming from the bug report template.
Metadata
Metadata
Assignees
Labels
No labels