imshow_simple_norm#
- astropy.visualization.imshow_simple_norm(data, ax=None, **kwargs)[source]#
A convenience function to call matplotlib’s
matplotlib.pyplot.imshowfunction, using anSimpleNormobject as the normalization.- Parameters:
- data2D or 3D numpy:array_like
The data to show. Can be whatever
imshowandSimpleNormboth accept. Seeimshow.- ax
python:NoneorAxes, optional If None, use pyplot’s imshow. Otherwise, calls
imshowmethod of the supplied axes.- **kwargs
python:dict, optional All other keyword arguments are parsed first by the
SimpleNorminitializer, then toimshow.
- Returns:
- result
python:tuple A tuple containing the
AxesImagegenerated byimshowas well as theImageNormalizeinstance generated bySimpleNorm.
- result
Notes
The
normmatplotlib keyword is not supported.Examples
import numpy as np import matplotlib.pyplot as plt from astropy.visualization import imshow_simple_norm # Generate and display a test image image = np.arange(65536).reshape((256, 256)) fig = plt.figure() ax = fig.add_subplot(1, 1, 1) im, norm = imshow_simple_norm(image, ax, origin='lower', min_percent=1, max_percent=99.9, stretch='sinh') fig.colorbar(im)