swiftemulator.comparison.visualisation module
Visualisation functions for comparison datasets.
Allows you to project a plausibility region for each parameter cross-correlation.
- swiftemulator.comparison.visualisation.visualise_penalties_mean(model_specification: ~swiftemulator.backend.model_specification.ModelSpecification, model_parameters: ~swiftemulator.backend.model_parameters.ModelParameters, penalties: ~typing.Dict[~typing.Hashable, float], norm: ~matplotlib.colors.Normalize = <matplotlib.colors.Normalize object>, remove_ticks: bool = True, figsize: ~typing.Optional[~typing.Tuple[float]] = None, use_parameters: ~typing.Optional[~typing.Iterable[str]] = None, use_colorbar: ~typing.Optional[bool] = False, highlight_model: ~typing.Optional[~typing.Hashable] = None) Tuple[Figure, Iterable[Axes]][source]
Visualises the penalties using SPH smoothing for each individual model point.
- Parameters:
model_specification (ModelSpecification) – The appropriate model specification. Used for the limits of the figure.
model_parameters (ModelParameters) – Parameters of the model, with the appropriate unique IDs.
penalties (Dict[Hashable, float]) – Penalties for all parameters in
model_parameters, with the key in this dictionary being the unique IDs.norm (Normalize, optional) – A
matplotlibnormalisation object. By default this usesvmin=0.2andvmax=0.7.remove_ticks (bool, optional) – Remove the axes ticks? This is recommended, as the plot can become very cluttered if you don’t do this. Default:
True.figsize (Tuple[float], optional) – The figure size to use. Defaults to 7 inches by 7 inches, the size for a
figure*in the MNRAS template.use_parameters (Iterable[str], optional) – The parameters to include in the figure. If not provided, all parameters in the
model_specificationare used.use_colorbar (Bool, optional) – Include a colorbar? Default: False
highlight_model (Hashable, optional) – The model unique ID to highlight. If not provided, no model is highlighted.
- Returns:
fig (Figure) – The figure object.
axes (np.ndarray[Axes]) – The individual axes.
Notes
You can either change how the figure looks by using the figure and axes objects that are returned, or by modifying the
matplotlibstylesheet you are currently using.
- swiftemulator.comparison.visualisation.visualise_penalties_generic_statistic(model_specification: ~swiftemulator.backend.model_specification.ModelSpecification, model_parameters: ~swiftemulator.backend.model_parameters.ModelParameters, penalties: ~typing.Dict[~typing.Hashable, float], statistic: ~typing.Optional[str] = None, norm: ~matplotlib.colors.Normalize = <matplotlib.colors.Normalize object>, remove_ticks: bool = True, figsize: ~typing.Optional[~typing.Tuple[float]] = None, use_parameters: ~typing.Optional[~typing.Iterable[str]] = None, use_colorbar: ~typing.Optional[bool] = False, highlight_model: ~typing.Optional[~typing.Hashable] = None) Tuple[Figure, Iterable[Axes]][source]
Visualises the penalties using basic binning.
- Parameters:
model_specification (ModelSpecification) – The appropriate model specification. Used for the limits of the figure.
model_parameters (ModelParameters) – Parameters of the model, with the appropriate unique IDs.
penalties (Dict[Hashable, float]) – Penalties for all parameters in
model_parameters, with the key in this dictionary being the unique IDs.statistic (str, optional) – The statistic that you would like to compute. Allowed values are the same as for
scipy.stats.binned_statistic_2d. Defaults tomean.norm (Normalize, optional) – A
matplotlibnormalisation object. By default this usesvmin=0.2andvmax=0.7.remove_ticks (bool, optional) – Remove the axes ticks? This is recommended, as the plot can become very cluttered if you don’t do this. Default:
True.figsize (Tuple[float], optional) – The figure size to use. Defaults to 7 inches by 7 inches, the size for a
figure*in the MNRAS template.use_parameters (Iterable[str], optional) – The parameters to include in the figure. If not provided, all parameters in the
model_specificationare used.use_colorbar (Bool, optional) – Include a colorbar? Default: False.
highlight_model (Hashable, optional) – The model unique ID to highlight. If not provided, no model is highlighted.
- Returns:
fig (Figure) – The figure object.
axes (np.ndarray[Axes]) – The individual axes.
Notes
You can either change how the figure looks by using the figure and axes objects that are returned, or by modifying the
matplotlibstylesheet you are currently using.