Skip to main content
`Ctrl`+`K`

# CoordinatesMap

class astropy.visualization.wcsaxes.CoordinatesMap(axes, transform=None, coord_meta=None, frame_class=<class 'astropy.visualization.wcsaxes.frame.RectangularFrame'>, previous_frame_path=None)

  Bases: `object`

  A container for coordinate helpers that represents a coordinate system.

  This object can be used to access coordinate helpers by index (like a list) or by name (like a dictionary).

  Parameters:
    axes `WCSAxes`

      The axes the coordinate map belongs to.

    transform `Transform`, optional

      The transform for the data.

    coord_meta `python:dict`, optional

      A dictionary providing additional metadata. This should include the keys `type`, `wrap`, and `unit`. Each of these should be a list with as many items as the dimension of the coordinate system. The `type` entries should be one of `longitude`, `latitude`, or `scalar`, the `wrap` entries should give, for the longitude, the angle at which the coordinate wraps (and `None` otherwise), and the `unit` should give the unit of the coordinates as `Unit` instances. This can optionally also include a `format_unit` entry giving the units to use for the tick labels (if not specified, this defaults to `unit`).

    frame_class type, optional

      The class for the frame, which should be a subclass of `BaseFrame`. The default is to use a `RectangularFrame`

    previous_frame_path `Path`, optional

      When changing the WCS of the axes, the frame instance will change but we might want to keep reusing the same underlying matplotlib `Path` - in that case, this can be passed to this keyword argument.

  Methods Summary

  `get_coord_range`() |
  `grid`([draw_grid, grid_type]) | Plot gridlines for both coordinates.
  `set_visible`(visibility) |

  Methods Documentation

  get_coord_range()
  grid(draw_grid=True, grid_type=None, **kwargs)

    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

      grid_type{ ‘lines’ | ‘contours’ }

        Whether to plot the contours by determining the grid lines in world coordinates and then plotting them in world coordinates (`'lines'`) or by determining the world coordinates at many positions in the image and then drawing contours (`'contours'`). The first is recommended for 2-d images, while for 3-d (or higher dimensional) cubes, the `'contours'` option is recommended. By default, ‘lines’ is used if the transform has an inverse, otherwise ‘contours’ is used.

  set_visible(visibility)