uvex_transients.phase_space.plotting.grid.plot_grid#

uvex_transients.phase_space.plotting.grid.plot_grid(grid: Table, points: Table | None = None, path: str | Path | None = None, title: str | None = None, *, fields: Sequence[str] | None = None, show_points: bool = False, annotate: Callable | None = None)[source]#

Draw a two-axis map: the success fraction, its yields and its uncertainty, from the metadata of the table alone.

The axes, their labels and units, and whether each is logarithmic come from the space in the table’s meta (grid_table() records it), so nothing here knows what the axes are. The first axis is drawn vertically and the second horizontally, as in plot_map(). A panel is made of the success fraction f, of every product that is drawn by default (one with draw set, such as a yield with an interval, <name>, <name>_lo and <name>_hi), and of sigma_log, unless fields says otherwise.

Parameters:
  • grid (astropy.table.Table) – The output of grid_table() of a map over two axes.

  • points (astropy.table.Table, optional) – The measured points (PhaseSpaceMap.table), drawn when show_points is set.

  • path (str or pathlib.Path, optional) – Where to write the figure. If omitted, the figure is not saved.

  • title (str, optional) – A suptitle.

  • fields (sequence of str, optional) – The columns to draw, one panel each.

  • show_points (bool, optional) – Whether to mark the measured points, as circles that grow with the number of tries.

  • annotate (callable, optional) – annotate(ax), called on every panel to draw anything else, such as the region a class of transients occupies. The coordinates are the plotted ones (the values of a logarithmic axis, not their logarithms). If it returns legend handles, the figure has a legend of the ones it returned for the first panel.

Returns:

The figure, left open so that it can be adjusted or shown.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If the table does not record its space, the space does not have two axes, or a column asked for is missing.