proplot-dev / proplot

🎨 A succinct matplotlib wrapper for making beautiful, publication-quality graphics
https://proplot.readthedocs.io
MIT License
1.07k stars 96 forks source link

unexpected minor ticks in colorbar #421

Open kinyatoride opened 1 year ago

kinyatoride commented 1 year ago

Description

I found a minor bug that when we plot a colorbar twice, unexpected minor ticks appear in the first colorbar.

Steps to reproduce

import numpy as np
import proplot as pplt

state = np.random.RandomState(51423)
data = 1 + (state.rand(12, 10) - 0.45).cumsum(axis=0)

fig, ax = pplt.subplots()

m = ax.pcolor(data)
ax.colorbar(m)
ax.colorbar(m)

pplt

Equivalent steps in matplotlib

import numpy as np
import matplotlib.pyplot as plt
state = np.random.RandomState(51423)
data = 1 + (state.rand(12, 10) - 0.45).cumsum(axis=0)

fig, ax = plt.subplots()

m = ax.pcolor(data)
plt.colorbar(m)
plt.colorbar(m)

plt

Proplot version

3.4.3 0.9.5