Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Imshow log normalization is looking different #30125

Closed as not planned
Closed as not planned
Labels
@XrioBtw

Description

@XrioBtw

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp