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
pointsarray 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 - replotbool,
optional Set to
Trueto use the values calculated by the last call toplot_trace. The default isFalse.- overplotbool,
optional If
Truethen add the data to an existing plot, otherwise create a new plot. The default isFalse.- clearwindowbool,
optional Should the existing plot area be cleared before creating this new plot (e.g. for multi-panel plots)?
- points
See also
get_drawsRun the pyBLoCXS MCMC algorithm.
get_trace_plotReturn the data used to plot the last trace.
plot_cdfPlot the cumulative density function of an array.
plot_pdfPlot the probability density function of an array.
plot_scatterCreate a scatter plot.
Examples
Plot the trace of the 500 elements in the
xarray:>>> 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')