plot_trace
- sherpa.astro.ui.plot_trace(points, name='x', xlabel='x', replot=False, overplot=False, clearwindow=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 byget_draws
.- Parameters:
points (array) – The values to plot on the Y axis.
name (str, optional) – The label to use on the Y axis and as part of the plot title.
xlabel (str, optional)
replot (bool, optional) – Set to
True
to use the values calculated by the last call toplot_trace
. The default isFalse
.overplot (bool, optional) – If
True
then add the data to an existing plot, otherwise create a new plot. The default isFalse
.clearwindow (bool, 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')