plot_pdf

sherpa.astro.ui.plot_pdf(points, name='x', xlabel='x', bins=12, normed=True, replot=False, overplot=False, clearwindow=True, **kwargs)

Plot the probability density function of an array of values.

Create and plot the probability density function (PDF) of the input array.

Parameters:
  • points (array) – The values used to create the probability density function.

  • name (str, optional) – The label to use as part of the plot title.

  • xlabel (str, optional) – The label for the X axis

  • bins (int, optional) – The number of bins to use to create the PDF.

  • normed (bool, optional) – Should the PDF be normalized (the default is True).

  • replot (bool, optional) – Set to True to use the values calculated by the last call to plot_pdf. The default is False.

  • overplot (bool, optional) – If True then add the data to an existing plot, otherwise create a new plot. The default is False.

  • 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_pdf_plot

Return the data used to plot the last PDF.

plot_cdf

Plot the cumulative density function of an array.

plot_scatter

Create a scatter plot.

Examples

>>> mu, sigma, n = 100, 15, 500
>>> x = np.random.normal(loc=mu, scale=sigma, size=n)
>>> plot_pdf(x, bins=25)
>>> plot_pdf(x, normed=False, xlabel="mu", name="Simulations")