Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
Usingnorm = "log"
normalization inimshow
is looking different in matplotlib version 3.10.1 than in version 3.6.0, which might be related toImprove formatting of image values in cases of singular norms
in version 3.9.2. The change is most likely intentional, as now it looks the same as if you manually log-transformed the image data. However, previously colours for the high number values were more pronounced, which was something I really liked. Can anyone show me how I can achieve the old log normalization behaviour via e.g.matplotlib.colors.LogNorm
or similar?
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotaspltimg=np.array([460,460,580,470,460,620,460,480,900,470,480,450,450,500,450,7300,470,470])img=np.repeat(np.array([np.tile(img,100)]),1000,axis=0).Tfig, (ax1,ax2)=plt.subplots(ncols=2,nrows=1)ax1.imshow(img,cmap="Blues",norm="log")ax2.imshow(np.log10(img),cmap="Blues")plt.show()
Actual outcome
Left image is what it looks like in matplotlib version 3.6.0, and the right image is what the left image looks like in matplotlib version 3.10.1 or if you manually log-transform the image.
Expected outcome
I would like to achieve the left image (more vibrant colours for the higher values) with a more recent matplotlib version.
Operating system
Windows
Matplotlib Version
3.6.0
Matplotlib Backend
TkAgg
Python version
3.6.0
Installation
pip