Closed
Description
Bug report
Bug summary
Some colorbar labels are printed twice when I use a colorbar with LogNorm and small ranges of numbers after setting the ticks manually with set_ticks().
See figure below: By setting the minor_thresholds to something low, the double ticklabel at 20000 disappears, so it could have something to do with the minor formatter in LogFormatterSciNotation?
I think it could be related to other issues that have been posted: #12488 #12503
Code for reproduction
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import matplotlib.ticker as ticker
fig, ax = plt.subplots()
pcm = ax.imshow([[10000, 25000]], norm=mcolors.LogNorm())
cb = fig.colorbar(pcm)
# cb.formatter.minor_thresholds = [0,0] # deactivates minor ticks labels?
cb.formatter = ticker.EngFormatter()
cb.set_ticks([10000,20000,25000])
Actual outcome
Expected outcome
There should be no double ticks.
Matplotlib version
- Operating system: OSX
- Matplotlib version: 3.0.2
- Matplotlib backend: Qt5Agg
- Python version: 3.7
- Jupyter version (if applicable): -
- Other libraries: -
I installed matplotlib via conda through the default channel.