matryoshka.plot
Some simple functions to conviently produce types of plots that might be needed frequently.
File containing some simple plotting functions.
- matryoshka.plot.per_err(truths, predictions, xvalues, xlabel=None, ylabel=None, xscale='linear', ylim=None, save=False, filename=None, title=None)
Function for plotting the scale dependent percentage error from emulator predictions.
- Parameters
truths (array) – Array containing the truth. Should have shape (n, k).
predictions (array) – Array containing the emulator predictions. Shouls have shape (n, k).
xvalues (array) – Array containing the x-values. Should have shape (k,).
xlabel (str) – X-axis label. Default is None.
ylabel (str) – Y-axis label. Default is None.
xscale (str) – Scaling for the x-axis. Default is None.
ylim (tuple) – Tuple containing limits for the y-axis. Default is None.
save (bool) – If True, the plot will be saved. If True, filename must not be None. Default is False.
filename (str) – Filename
title (str) – Title of the plot, Default is None.
- matryoshka.plot.sample_space(samples_list, param_labels, save=False, figsize=(15, 15), filename=None, set_labels=None, colour_variable=None, bounds=None, bounds_colour='lightgray', param_label_size='large', tick_label_size='medium', leg_label_size='large', marker_sizes=None)
Function for producing a corner plot of the sample space. Adapted from corner by Daniel Foreman-Mackey.
- Parameters
samples_list (list) – List of arrays with shape (n, d).
param_labels (list) – Labels for each dimension of the sample space. Should habe length d.
save (bool) – If True, the plot will be saved. If True, filename must not be None. Default is False.
figsize (tuple) – Tuple that defines the size of the plot. Default is (15, 15).
filename (str) – Filename. Default is None.
set_labels (list) – Label for each element in samples_list. Default is None. Only pass when samples_list has more than one element.
colour_variable (array) – Array containing a varibale to determine the colour of each sample , e.g. the prediction error for that sample. Should have shape n. Default is None. Cannot be used is samples_list has more than one element.
bounds (array) – Array containing bounds to be plotted. Should have shape (d,2). Default is None.
bounds_colour (str) – Colour of bounds. Default is ‘lightgrey’.
param_label_size (str or float) – The size of parameter labels. Can be a string or a float. Default is ‘large’.
tick_label_size (str or float) – The size of tick labels. Can be a string or a float. Default is ‘medium’.
leg_label_size (str or float) – The size of legend labels. Can be a string or a float. Default is ‘large’.
marker_sizes (list) – List of floats specifying the marker sizes for the scatter plots. Default is None.