You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug summary
Colorbars have their own minorticks_on/off methods to address the issue of minorticks extending into the "extend" regions (see #11584).
Since colorbar axes are instances of normal axes, setting rcParams['y/xtick.minor.visible'] = True
results in minorticks being drawn on the colorbar axes using the axes methods (which don't take into account the "extend" regions).
Code for reproduction
importmatplotlib.pyplotaspltimportnumpyasnp# Making yticks longer in length to highlight the issueplt.rcParams['ytick.major.size'] =10plt.rcParams['ytick.minor.size'] =4plt.rcParams['ytick.minor.visible'] =True# Similar issue with plt.rcParams['xtick.minor.visible'] = True and horizontal colorbarnp.random.seed(seed=12345)
x=np.random.randn(20, 20)
fig, ax=plt.subplots(figsize=(4, 3), constrained_layout=True)
im=ax.pcolormesh(x)
cbar=fig.colorbar(im, extend='both', orientation='vertical')
# Similar issue with plt.rcParams['xtick.minor.visible'] = True and horizontal colorbarfig.savefig('cbar_minorticks_issue.png')
Bug report
Bug summary
Colorbars have their own
minorticks_on/off
methods to address the issue of minorticks extending into the "extend" regions (see #11584).Since colorbar axes are instances of normal axes, setting
rcParams['y/xtick.minor.visible'] = True
results in minorticks being drawn on the colorbar axes using the axes methods (which don't take into account the "extend" regions).
Code for reproduction
Actual outcome

Expected outcome

Matplotlib version
print(matplotlib.get_backend())
):The text was updated successfully, but these errors were encountered: