plot_trace

sherpa.astro.ui.plot_trace(points: ArrayType, name: str = 'x', xlabel: str = 'x', replot: bool = False, overplot: bool = False, clearwindow: bool = True, **kwargs) None

Create a trace plot of row number versus value.

Display a plot of the points array values (Y axis) versus row number (X axis). This can be useful to view how a value changes, such as the value of a parameter returned by get_draws.

Parameters:
pointsarray

The values to plot on the Y axis.

namestr, optional

The label to use on the Y axis and as part of the plot title.

xlabelstr, optional
replotbool, optional

Set to True to use the values calculated by the last call to plot_trace. The default is False.

overplotbool, optional

If True then add the data to an existing plot, otherwise create a new plot. The default is False.

clearwindowbool, optional

Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)?

See also

get_draws

Run the pyBLoCXS MCMC algorithm.

get_trace_plot

Return the data used to plot the last trace.

plot_cdf

Plot the cumulative density function of an array.

plot_pdf

Plot the probability density function of an array.

plot_scatter

Create a scatter plot.

Examples

Plot the trace of the 500 elements in the x array:

>>> mu, sigma = 100, 15
>>> x = mu + sigma * np.random.randn(500)
>>> plot_trace(x)

Use “ampl” as the Y axis label:

>>> plot_trace(ampl, name='ampl')