:py:mod:`nessai.plot` ===================== .. py:module:: nessai.plot .. autoapi-nested-parse:: Plotting utilities. .. !! processed by numpydoc !! Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: nessai.plot.plot_live_points nessai.plot.plot_1d_comparison nessai.plot.plot_indices nessai.plot.plot_loss nessai.plot.plot_trace nessai.plot.plot_histogram Attributes ~~~~~~~~~~ .. autoapisummary:: nessai.plot.logger nessai.plot.pairplot_kwargs .. py:data:: logger .. !! processed by numpydoc !! .. py:data:: pairplot_kwargs .. !! processed by numpydoc !! .. py:function:: 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_points** : ndarray Structured array of live points to plot. **filename** : str Filename for resulting figure **bounds** : dict: Dictionary of lower and upper bounds to plot **c** : str, 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`` and ``plot_kws``. .. !! processed by numpydoc !! .. py:function:: 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_points** : iterable of ndarrays Variable length argument of live points in structured arrays with fields. Also see ``parameters`` argument. **parameters** : array_like, optional Array of parameters (field names) to plot. Default None implies all fields are plotted. **labels** : list, optional List of labels for each structured array being plotted (default None). If None each set of live points is labelled numerically **colours** : list, optional List of colours to use for each set of live points. **bounds** : dict, 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_kwargs** : dict, optional Dictionary of keyword arguments passed to matplotlib.pyplot.hist. **filename** : str, optional Name of file for saving figure. (Default None implies figure is not saved). **convert_to_live_points** : bool, optional Set to true if inputs are not structured arrays of live points .. !! processed by numpydoc !! .. py:function:: plot_indices(indices, nlive=None, filename=None, plot_breakdown=True) Histogram indices for index insertion tests, also includes the CDF. :Parameters: **indices** : array_like List of insertion indices to plot **nlive** : int Number of live points used in the nested sampling run **filename** : str Filename used to save the figure. **plot_breakdown** : bool, optional If true, then the CDF for every nlive points is also plotted as grey lines. .. !! processed by numpydoc !! .. py:function:: plot_loss(epoch, history, filename=None) Plot the loss function per epoch. :Parameters: **epoch** : int Final training epoch **history** : dict Dictionary with keys ``'loss'`` and ``'val_loss'`` **filename** : str, optional Path for saving the figure. If not specified figure is returned instead. .. !! processed by numpydoc !! .. py:function:: 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_x** : array_like Array of log prior volumnes **nested_samples** : ndrray Array of nested samples to plot **labels** : list, optional List of labels to use instead of the names of parameters **filename** : str, optional Filename for saving the plot, if none plot is not saved and figure is returned instead. .. !! processed by numpydoc !! .. py:function:: plot_histogram(samples, label=None, filename=None, **kwargs) Plot a histogram of samples. :Parameters: **samples** : array_like Samples to plot. **label** : str, optional Label to the x axis. **filename** : str, optional Filename for saving the plot. If not specified, figure is returned. **kwargs** Keyword arguments passed to `matplotlib.pyplot.hist`. .. !! processed by numpydoc !!