Closed
Description
Bug report
Extra minorticks appear at an extended part of colorbar with ticks=LogLocator(numticks=10, subs='all')
.
Code for reproduction
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from matplotlib.ticker import LogLocator
v = np.geomspace(1e0, 1e4, num=3 * 4).reshape(3, 4)
fig, axs = plt.subplots(figsize=(6, 2))
pc = axs.pcolormesh(v, norm=LogNorm())
fig.colorbar(pc, extend='both')
fig, axs = plt.subplots(figsize=(6, 2))
pc = axs.pcolormesh(v, norm=LogNorm())
fig.colorbar(pc, extend='both', ticks=LogLocator(numticks=10))
fig, axs = plt.subplots(figsize=(6, 2))
pc = axs.pcolormesh(v, norm=LogNorm())
fig.colorbar(pc, extend='both', ticks=LogLocator(numticks=10, subs='all'))
Actual outcome
Expected outcome
Minor ticks appear only at the body of the colorbar.
Probably this is not a right usage for the subs
option, but I just want to show minor ticks, which by default are not shown for a short colorbar.
Matplotlib version
- Operating system:
- Matplotlib version: 3.3.4
- Matplotlib backend: module://ipykernel.pylab.backend_inline
- Python version: 3.7.9
- Jupyter version (if applicable): Jupyterlab 3.0.8
- Other libraries:
All installed by conda install -c conda-forge ...
Metadata
Metadata
Assignees
Labels
No labels