Plotting APIs

See Plotting Examples for examples.

Matplotlib Interface

class cornish.plot.matplotlib.SkyPlot(extent=None, figsize=(12.0, 12.0))[source]

Bases: cornish.plot.cornish.CornishPlot

A convenience class providing a high level interface for creating sky plots in Matplotlib.

Parameters
  • extent (Optional[ASTRegion]) – an ASTRegion that encompasses the full area to plot

  • figsize (Tuple[float, float]) – width,height of the plot figure in inches (parameter passed directly to matplotlib.figure.Figure)

addPoints(ra=None, dec=None, points=None, style=1, size=None, colour=None, color=None)[source]

Draw a point onto an existing plot.

:widths 20 25 25
header-rows

1

    • marker_style value

    • style
      • string equivalent

    • 1

    • small circle
      • circle

    • 2

  • cross
    • cross

    • 3

  • star
    • star

    • 4

  • larger circle
    • circle

    • 5

  • x
    • x

    • 6

  • pixel dot
    • dot

    • 7

  • triangle pointing up
    • triangle

    • 8

  • triangle pointing down
    • triangle down

    • 9

  • triangle pointing left
    • triangle left

    • 10

  • triangle pointing right
    • triangle right

    • 11

  • param points

    point should be in degrees (e.g. list or numpy.ndarray, or a pair (list/tuple) of astropy.units.Quantity values, or a SkyCoord, or a container of these (all in the same form)

    param style

    an integer corresponding to one of the built-in marker styles

    param colour

    marker plot colour

    param color

    synonym for ‘colour’

    param size

    scale point size by this value

addRegionOutline(region, colour='#4a7f7b', color=None, style=1)[source]

Overlay the outline of the provided region to the plot.

Parameters
  • region (Union[ASTRegion, Region]) – the region to draw

  • colour (str) – a color name (e.g. black) or hex code (e.g. #4a7f7b)

  • color – synonym for ‘colour’

  • style (int) – line style: 1=solid, 2=solid, 3=dashes, 4=short dashes, 5=long dashes

figure()[source]

Return the matplotlib.figure.Figure object for plot customization outside of this API.

show()[source]

Display the plot (passthrough for matplotlib.pyplot.show()).