astropy.visualization.wcsaxes.add_beam(ax, header=None, major=None, minor=None, angle=None, corner='bottom left', frame=False, borderpad=0.4, pad=0.5, **kwargs)[source]#

Display the beam shape and size.


WCSAxes instance in which the beam shape and size is displayed. The WCS must be celestial.

headerHeader, optional

Header containing the beam parameters. If specified, the BMAJ, BMIN, and BPA keywords will be searched in the FITS header to set the major and minor axes and the position angle on the sky.

majorfloat or Quantity, optional

Major axis of the beam in degrees or an angular quantity.

minorfloat, or Quantity, optional

Minor axis of the beam in degrees or an angular quantity.

anglefloat or Quantity, optional

Position angle of the beam on the sky in degrees or an angular quantity in the anticlockwise direction.

cornerstr, optional

The beam location. Acceptable values are 'left', 'right', 'top', ‘bottom’, 'top left', 'top right', 'bottom left' (default), and 'bottom right'.

framebool, optional

Whether to display a frame behind the beam (default is False).

borderpadfloat, optional

Border padding, in fraction of the font size. Default is 0.4.

padfloat, optional

Padding around the beam, in fraction of the font size. Default is 0.5.


Additional arguments are passed to matplotlib.patches.Ellipse.


This function may be inaccurate when:

  • The pixel scales at the reference pixel are different from the pixel scales within the image extent (e.g., when the reference pixel is well outside of the image extent and the projection is non-linear)

  • The pixel scales in the two directions are very different from each other (e.g., rectangular pixels)