atompy.Hist2d.for_imshow#
- property Hist2d.for_imshow#
Return corresponding
ImshowDataobject.Assumes that the origin of the image is specified by matplotlib.rcParams[“image.origin”]
- Returns:
- imshow_data
ImshowData A data type storing an image and the extent of the image.
imshow_data.image: 2d pixel arrayimshow_data_extent: the extents of the image
- imshow_data
Examples
hist = Hist2d(*np.histogram2d(xsamples, ysamples)) image, extent = hist.for_imshow plt.imshow(image, extent=extent) # or (calling *imshow_data* returns a dictionary) plt.imshow(**hist.for_imshow()) # or imshow_data = hist.for_imshow plt.imshow(imshow_data.image, extent=imshow_data.extent)