nessai.plot
Plotting utilities.
Module Contents
Functions
|
Plot a set of live points in a corner-like plot. |
|
Plot 1d histograms comparing different sets of live points |
|
Histogram indices for index insertion tests, also includes the CDF. |
|
Plot the loss function per epoch. |
|
Produce trace plot for all of the parameters. |
|
Plot a histogram of samples. |
Attributes
- nessai.plot.logger
- nessai.plot.pairplot_kwargs
- nessai.plot.plot_live_points(live_points, filename=None, bounds=None, c=None, **kwargs)
Plot a set of live points in a corner-like plot.
- Parameters
- live_pointsndarray
Structured array of live points to plot.
- filenamestr
Filename for resulting figure
- boundsdict:
Dictionary of lower and upper bounds to plot
- cstr, optional
Name of field in the structured array to use as the hue when plotting the samples. If not specified, no hue is used.
- kwargs
Keyword arguments used to update the pairplot kwargs. Diagonal and off- diagonal plots can be configured with
diag_kws
andplot_kws
.
- nessai.plot.plot_1d_comparison(*live_points, parameters=None, labels=None, colours=None, bounds=None, hist_kwargs={}, filename=None, convert_to_live_points=False)
Plot 1d histograms comparing different sets of live points
- Parameters
- *live_pointsiterable of ndarrays
Variable length argument of live points in structured arrays with fields. Also see
parameters
argument.- parametersarray_like, optional
Array of parameters (field names) to plot. Default None implies all fields are plotted.
- labelslist, optional
List of labels for each structured array being plotted (default None). If None each set of live points is labelled numerically
- colourslist, optional
List of colours to use for each set of live points.
- boundsdict, optional
Dictionary of upper and lowers bounds to plot. Each key must match a field and each value must be an interable of length 2 in order lower then upper bound. If None (default), no bounds plotted.
- hist_kwargsdict, optional
Dictionary of keyword arguments passed to matplotlib.pyplot.hist.
- filenamestr, optional
Name of file for saving figure. (Default None implies figure is not saved).
- convert_to_live_pointsbool, optional
Set to true if inputs are not structured arrays of live points
- nessai.plot.plot_indices(indices, nlive=None, filename=None, plot_breakdown=True)
Histogram indices for index insertion tests, also includes the CDF.
- Parameters
- indicesarray_like
List of insertion indices to plot
- nliveint
Number of live points used in the nested sampling run
- filenamestr
Filename used to save the figure.
- plot_breakdownbool, optional
If true, then the CDF for every nlive points is also plotted as grey lines.
- nessai.plot.plot_loss(epoch, history, filename=None)
Plot the loss function per epoch.
- Parameters
- epochint
Final training epoch
- historydict
Dictionary with keys
'loss'
and'val_loss'
- filenamestr, optional
Path for saving the figure. If not specified figure is returned instead.
- nessai.plot.plot_trace(log_x, nested_samples, labels=None, filename=None)
Produce trace plot for all of the parameters.
This includes all parameters in the sampler, not just those included in the model being sampled.
- Parameters
- log_xarray_like
Array of log prior volumnes
- nested_samplesndrray
Array of nested samples to plot
- labelslist, optional
List of labels to use instead of the names of parameters
- filenamestr, optional
Filename for saving the plot, if none plot is not saved and figure is returned instead.
- nessai.plot.plot_histogram(samples, label=None, filename=None, **kwargs)
Plot a histogram of samples.
- Parameters
- samplesarray_like
Samples to plot.
- labelstr, optional
Label to the x axis.
- filenamestr, optional
Filename for saving the plot. If not specified, figure is returned.
- kwargs
Keyword arguments passed to matplotlib.pyplot.hist.