WCSAxes¶
-
class
wcsaxes.WCSAxes(fig, rect, wcs=None, transform=None, coord_meta=None, transData=None, slices=None, frame_class=<class 'wcsaxes.frame.RectangularFrame'>, **kwargs)[source]¶ Bases:
matplotlib.axes._axes.AxesMethods Summary
draw(renderer[, inframe])get_coords_overlay(frame[, coord_meta])get_tightbbox(renderer)get_transform(frame)Return a transform from the specified frame to display coordinates. get_xlabel()get_ylabel()grid([draw_grid])Plot gridlines for both coordinates. imshow(X, \*args, \*\*kwargs)Wrapper to Matplotlib’s imshow().reset_wcs([wcs, slices, transform, coord_meta])Reset the current Axes, to use a new WCS object. set_xlabel(label)set_ylabel(label)Methods Documentation
-
get_transform(frame)[source]¶ Return a transform from the specified frame to display coordinates.
This does not include the transData transformation
Parameters: frame :
WCSorTransformor str- The
frameparameter can have several possible types: WCSinstance: assumed to be a transformation from pixel to world coordinates, where the world coordinates are the same as those in the WCS transformation used for thisWCSAxesinstance. This is used for example to show contours, since this involves plotting an array in pixel coordinates that are not the final data coordinate and have to be transformed to the common world coordinate system first.Transforminstance: it is assumed to be a transform to the world coordinates that are part of the WCS used to instantiate thisWCSAxesinstance.'pixel'or'world': return a transformation that allows users to plot in pixel/data coordinates (essentially an identity transform) andworld(the default world-to-pixel transformation used to instantiate theWCSAxesinstance).'fk5'or'galactic': return a transformation from the specified frame to the pixel/data coordinates.BaseCoordinateFrameinstance.
- The
-
grid(draw_grid=True, **kwargs)[source]¶ Plot gridlines for both coordinates.
Standard matplotlib appearance options (color, alpha, etc.) can be passed as keyword arguments.
Parameters: draw_grid : bool
Whether to show the gridlines
-
imshow(X, *args, **kwargs)[source]¶ Wrapper to Matplotlib’s
imshow().If an RGB image is passed as a PIL object, it will be flipped vertically and
originwill be set tolower, since WCS transformations - like FITS files - assume that the origin is the lower left pixel of the image (whereas RGB images have the origin in the top left).All arguments are passed to
imshow().
-