Samples.plot_gaussian (function)
def plot_gaussian(self, x=None, unit=None, wrap_at=None, label=None, xlabel=None, show=False, **kwargs)
Plot the gaussian distribution that would result from calling Samples.to_gaussian with the same arguments.
Note that for distributions in which Samples.to_gaussian calls Samples.to_histogram under-the-hood, this could result in slightly different distributions for each call.
See also:
x
(array, optional, default=None): the numpy array at which to sample the value on the x-axis. Ifunit
is not None, the value ofx
are assumed to be in the original units Samples.unit, notunit
. If not provided or None,x
will be based to cover the 99.9% of all distributions (see Samples.interval) with 1000 points and 10% padding.unit
(astropy.unit, optional, default=None): units to use along the x-axis. Astropy must be installed.wrap_at
(float, None, or False, optional, default=None): value to use for wrapping. See Samples.wrap. If not provided or None, will use the value from Samples.wrap_at. Note: wrapping is computed before changing units, sowrap_at
must be provided according to Samples.unit notunit
.label
(string, optional, default=None): override the label on the x-axis. If not provided or None, will use Samples.label. Will only be used ifshow=True
. Unit will automatically be appended. Will be ignored ifxlabel
is provided.xlabel
(string, optional, default=None): override the label on the x-axis without appending the unit. Will overridelabel
.show
(bool, optional, default=True): whether to show the resulting matplotlib figure.**kwargs
: keyword arguments forsigma
,N
,bins
,range
will be passed on to Samples.to_gaussian (must be accepted by the given distribution type). All other keyword arguments will be passed on to Gaussian.plot_pdf on the resulting distribution.
- the return from plt.plot
- ImportError: if matplotlib dependency is not met.