Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug report
Bug summary
Minor ticks don't appear in the right place in colorbars when a custom Normalize class is used.
Code for reproduction
The following example requiresastropy. If needed I can try and provide an example that doesn't use this.
importnumpyasnpimportmatplotlib.pyplotaspltfromastropy.visualizationimportLogStretch,ImageNormalize,PercentileIntervaldata=np.arange(256).reshape((16,16))norm=ImageNormalize(data,interval=PercentileInterval(99),stretch=LogStretch())plt.rcParams['xtick.minor.visible']=Truefig=plt.figure()ax=fig.add_subplot(1,1,1)im=ax.imshow(data,norm=norm)cb=fig.colorbar(im)fig.savefig('test.png')
Actual outcome
Expected outcome
The minor ticks should respect the spacing of the current stretch.
I noticed that using LogNorm, the ticks used to be spaced incorrectly in Matplotlib 2.2 but this was fixed in Matplotlib 3.0. However, the minor ticks are still broken for custom normalizations as shown above.
Matplotlib version
- Operating system: MacOS X 10.13.6
- Matplotlib version: 3.0.1
- Matplotlib backend: Agg
- Python version: 3.7.1