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

Blank colorbars for high dynamic range LogNorm imshow plots #10051

Closed
@ngoldbaum

Description

@ngoldbaum

Bug summary

When creating a LogNorm imshow plot with more than 9 orders of magnitude of dynamic range the automatically generated colorbar from plt.colorbar() has no automatically generated tick marks or labels.

Code for reproduction

This generates a plot with colorbar tick labels

importnumpyasnpfrommatplotlibimportpyplotaspltfrommatplotlib.colorsimportLogNormdata=np.zeros((800,800))+1data[50,51]=1e9print(np.log10(data.max()/data.min()))image=plt.imshow(data,origin='lower',interpolation='nearest',norm=LogNorm())plt.colorbar(image)plt.savefig('labels.png')

labels

While this script generates a plot with no colorbar tick labels:

importnumpyasnpfrommatplotlibimportpyplotaspltfrommatplotlib.colorsimportLogNormdata=np.zeros((800,800))+1data[50,51]=2e9print(np.log10(data.max()/data.min()))image=plt.imshow(data,origin='lower',interpolation='nearest',norm=LogNorm())plt.colorbar(image)plt.savefig('no-labels.png')

no-labels

Expected outcome

I would expect the second plot to also have colorbar tick labels.

Matplotlib version

  • Operating system: Mac OS High Sierra
  • Matplotlib version: 2.1.1 (installed via pip)
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: 3.6

Metadata

Metadata

Assignees

No one assigned

    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