plot_scatter
- sherpa.ui.plot_scatter(x: ArrayType, y: ArrayType, name: str = '(x,y)', xlabel: str = 'x', ylabel: str = 'y', replot: bool = False, overplot: bool = False, clearwindow: bool = True, **kwargs) None
Create a scatter plot.
- Parameters:
- x
array The values to plot on the X axis.
- y
array The values to plot on the Y axis. This must match the size of the
xarray.- name
str,optional The plot title.
- xlabel
str,optional The label for the X axis.
- ylabel
str,optional The label for the Y axis.
- replotbool,
optional Set to
Trueto use the values calculated by the last call toplot_scatter. 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)?
- x
See also
get_scatter_plotReturn the data used to plot the last scatter plot.
plot_traceCreate a trace plot of row number versus value.
Examples
Plot the X and Y points:
>>> mu, sigma, n = 100, 15, 500 >>> x = mu + sigma * np.random.randn(n) >>> y = mu + sigma * np.random.randn(n) >>> plot_scatter(x, y)
Change the axis labels and the plot title:
>>> plot_scatter(nh, kt, xlabel='nH', ylabel='kT', name='Simulations')