get_order_plot

sherpa.astro.ui.get_order_plot(id: IdType | None = None, orders=None, recalc: bool = True, copy: bool = True)

Return the data used by plot_order.

Changed in version 4.19.0: The plot object is now copied by default. To get the previous behaviour set the copy attribute to False.

Parameters:
idint, str, or None,optional

The data set that provides the data. If not given then the default identifier is used, as returned by get_default_id.

ordersoptional

Which response to use. The argument can be a scalar or array, in which case multiple curves will be displayed. The default is to use all orders.

recalcbool, optional

If False then the results from the last call to plot_order (or get_order_plot) are returned, otherwise the data is re-generated.

copybool, optional

Is the plot object copied before being returned? If so then the plot attributes will not be changed by multiple calls to this routine.

Returns:
dataa sherpa.astro.plot.OrderPlot instance

An object representing the data used to create the plot by plot_order.

See also

get_default_id

Return the default data set identifier.

plot_order

Plot the model for a data set convolved by the given response.

Examples

Retrieve the plot information for order 1 of the default data set and then display it:

>>> oplot = get_order_plot(orders=1)
>>> print(oplot)

Return the plot data for orders 1 and 2 of data set ‘jet’, plot the first and then overplot the second:

>>> plots = get_order_plot('jet', orders=[1, 2])
>>> plots[0].plot()
>>> plots[1].overplot()