Skip to content

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

@astrofrog

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

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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy