MVHistogramSlice.plot_sample (function)
def plot_sample(self, *args, **kwargs)
Plot both a sampled histogram from the distribution. Requires matplotlib to be installed.
See also:
- MVHistogramSlice.plot
- MVHistogramSlice.plot_pdf
- MVHistogramSlice.plot_cdf
- MVHistogramSlice.plot_gaussian
- MVHistogramSlice.plot_uncertainties
Arguments
size
(int, optional, default=1e5): number of points to sample for the histogram. See also MVHistogramSlice.sample. Will be ignored ifsamples
is provided.unit
(astropy.unit, optional, default=None): units to use along the x-axis. Astropy must be installed. Ifsamples
is provided, the passed values will be assumed to be in the correct units.wrap_at
(float, None, or False, optional, default=None): value to use for wrapping. See MVHistogramSlice.wrap. If not provided or None, will use the value from MVHistogramSlice.wrap_at. Note: wrapping is computed before changing units, sowrap_at
must be provided according to MVHistogramSlice.unit notunit
. Will be ignored ifsamples
is provided.seed
(int, optional): seed to use when sampling. See also MVHistogramSlice.sample. Will be ignored ifsamples
is provided.samples
(array, optional, default=None): plot specific sampled values instead of calling MVHistogramSlice.sample internally. Will overridesize
.label
(string, optional, default=None): override the label on the x-axis. If not provided or None, will use MVHistogramSlice.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
: all keyword arguments will be passed on to plt.hist. If not provided,bins
will default to the stored bins for Histogram distributions, otherwise will default to 25.
Returns
- the return from plt.hist
Raises
- ImportError: if matplotlib dependency is not met.