Severe bug in ``imshow`` when plotting images with small values · Issue #6394 · matplotlib/matplotlib · GitHub
Skip to content

Severe bug in imshow when plotting images with small values #6394

Description

@astrofrog

The following minimal example:

import matplotlib
matplotlib.use('Agg')
from astropy.wcs import WCS
from wcsaxes import datasets
import matplotlib.pyplot as plt
hdu = datasets.fetch_msx_hdu()
plt.imshow(hdu.data, vmin=-2e-4, vmax=2e-4)
plt.savefig('image.png')

produces the following output:

image

This appears to be related to the fact the values in the image data are < 1. If I multiply all the values by 1e6, I get something sensible:

plt.imshow(hdu.data * 1e6, vmin=-2e-4, vmax=2e-4)
plt.savefig('image.png')

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions