VegaPlots¶
-
class
vega.plots.plot.VegaPlots(vega_data=None)[source]¶ Initialize plotting module with the vega internal info
Parameters: - vega_data (vega.Data, optional) – Vega data object, by default None
- models (List[np.array] or List[dict], optional) – List of models, by default None
-
initialize_wedge(mu_bin, corr_name=None, is_data=False, cross_flag=False, rp_setup=None, rt_setup=None, r_setup=None, abs_mu=True, **kwargs)[source]¶ Initialize wedge object
Parameters: - mu_bin ((float, float)) – Min and max mu value defining the wedge
- corr_name (str, optional) – Name of the correlation component, by default None
- cross_flag (bool, optional) – Whether the wedge is for the cross-correlation, by default False
- rp_setup ((float, float, int), optional) – (min, max, size) specification for input r_parallel, by default None
- rt_setup ((float, float, int), optional) – (min, max, size) specification for input r_transverse, by default None
- r_setup ((float, float, int), optional) – (min, max, size) specification for output isotropic r, by default None
- abs_mu (bool, optional) – Whether to compute wedges in abs(mu), by default True
Returns: Vega wedge object
Return type: vega.Wedge
-
plot_1wedge(models=None, cov_mat=None, labels=None, data=None, cross_flag=False, corr_name='lyaxlya', models_only=False, data_only=False, data_label=None, fig=None, **kwargs)[source]¶ Plot the correlations into one wedge from mu=0 to mu=1
Parameters: - models (List[array] or List[dict], optional) – List of models to plot, by default None
- cov_mat (array or dict, optional) – Covariance matrix as an array or a dictionary of components, by default None
- labels (List[str], optional) – List of labels for the models, by default None
- data (array or dict, optional) – Data vector as an array or a dictionary of components, by default None
- cross_flag (bool, optional) – Whether the wedge is for the cross-correlation, by default False
- corr_name (str, optional) – Name of the correlation component, by default ‘lyaxlya’
- models_only (bool, optional) – Whether to only plot models and ignore the data, by default False
- data_only (bool, optional) – Whether to only plot data and ignore the models, by default False
- data_label (str, optional) – Label for the data, by default None
-
plot_2wedges(mu_bins=(0, 0.5, 1), models=None, cov_mat=None, labels=None, data=None, cross_flag=False, corr_name='lyaxlya', models_only=False, data_only=False, data_label=None, vertical_plots=False, fig=None, **kwargs)[source]¶ Plot the correlations into two wedges defined by the limits in mu_bins
Parameters: - mu_bins (tuple, optional) – Limits of mu bins that define the two wedges, by default (0, 0.5, 1)
- models (List[array] or List[dict], optional) – List of models to plot, by default None
- cov_mat (array or dict, optional) – Covariance matrix as an array or a dictionary of components, by default None
- labels (List[str], optional) – List of labels for the models, by default None
- data (array or dict, optional) – Data vector as an array or a dictionary of components, by default None
- cross_flag (bool, optional) – Whether the wedge is for the cross-correlation, by default False
- corr_name (str, optional) – Name of the correlation component, by default ‘lyaxlya’
- models_only (bool, optional) – Whether to only plot models and ignore the data, by default False
- data_only (bool, optional) – Whether to only plot data and ignore the models, by default False
- data_label (str, optional) – Label for the data, by default None
- vertical_plots (bool, optional) – Whether to plot the two wedges vertically, by default False
-
plot_4wedge_panel(mu_bins=(0, 0.5, 0.8, 0.95, 1), model=None, cov_mat=None, data=None, cross_flag=False, corr_name='lyaxlya', colors=None, data_only=False, title=None, figsize=(8, 6), fig=None, **kwargs)[source]¶ Plot the correlations into four wedges on one panel
Parameters: - mu_bins (tuple, optional) – Limits of mu bins that define the two wedges, by default (0, 0.5, 1)
- model (array or dict, optional) – Model to plot, by default None
- cov_mat (array or dict, optional) – Covariance matrix as an array or a dictionary of components, by default None
- data (array or dict, optional) – Data vector as an array or a dictionary of components, by default None
- cross_flag (bool, optional) – Whether the wedge is for the cross-correlation, by default False
- corr_name (str, optional) – Name of the correlation component, by default ‘lyaxlya’
- colors (List[string], optional) – List of colors for the wedges, by default None
- data_only (bool, optional) – Whether to only plot data and ignore the models, by default False
- title (string, optional) – Title for plot, by default None
- figsize ((float, float), optional) – figsize object passed to plt.subplots, by default (10, 6)
-
plot_4wedges(mu_bins=(0, 0.5, 0.8, 0.95, 1), models=None, cov_mat=None, labels=None, data=None, cross_flag=False, corr_name='lyaxlya', models_only=False, data_only=False, data_label=None, figsize=(14, 8), mu_bin_labels=False, fig=None, **kwargs)[source]¶ Plot the correlations into four wedges defined by the limits in mu_bins
Parameters: - mu_bins (tuple, optional) – Limits of mu bins that define the two wedges, by default (0, 0.5, 1)
- models (List[array] or List[dict], optional) – List of models to plot, by default None
- cov_mat (array or dict, optional) – Covariance matrix as an array or a dictionary of components, by default None
- labels (List[str], optional) – List of labels for the models, by default None
- data (array or dict, optional) – Data vector as an array or a dictionary of components, by default None
- cross_flag (bool, optional) – Whether the wedge is for the cross-correlation, by default False
- corr_name (str, optional) – Name of the correlation component, by default ‘lyaxlya’
- models_only (bool, optional) – Whether to only plot models and ignore the data, by default False
- data_only (bool, optional) – Whether to only plot data and ignore the models, by default False
- data_label (str, optional) – Label for the data, by default None
-
plot_data(ax, mu_bin, data=None, cov_mat=None, cross_flag=False, label=None, corr_name='lyaxlya', data_fmt='o', data_color=None, scaling_power=2, use_local_coordinates=True, **kwargs)[source]¶ Plot the data in the input ax object using the input wedge object
Parameters: - ax (plt.axes) – Axes object to plot the data in
- data (array or dict, optional) – Data vector as an array or a dictionary of components, by default None
- cov_mat (array or dict, optional) – Covariance matrix as an array or a dictionary of components, by default None
- label (str, optional) – Label for the data points, by default None
- corr_name (str, optional) – Name of the correlation component, by default ‘lyaxlya’
- data_fmt (str, optional) – Data formatting, by default ‘o’
- data_color (str, optional) – Color for the data points, by default None
- scaling_power (float, optional) – The power of r that multiples the plotted correlation (xi * r^scaling_power), by default None
- use_local_coordinates (bool, optional) – Whether to use the stored coordinate settings or defaul/input values, by default True
-
plot_model(ax, mu_bin, model=None, cov_mat=None, cross_flag=False, label=None, corr_name='lyaxlya', model_ls='-', model_color=None, scaling_power=2, use_local_coordinates=True, **kwargs)[source]¶ Plot the model in the input ax object using the input wedge object
Parameters: - ax (plt.axes) – Axes object to plot the model in
- wedge_obj (vega.Wedge) – Vega wedge object for computing the wedge
- model (array or dict, optional) – Model vector as an array or a dictionary of components, by default None
- cov_mat (array or dict, optional) – Covariance matrix as an array or a dictionary of components, by default None
- label (str, optional) – Label for the model, by default None
- corr_name (str, optional) – Name of the correlation component, by default ‘lyaxlya’
- model_ls (str, optional) – Model line style, by default ‘-’
- model_color (str, optional) – Color for the model line, by default None
- scaling_power (float, optional) – The power of r that multiples the plotted correlation (xi * r^scaling_power), by default None
- use_local_coordinates (bool, optional) – Whether to use the stored coordinate settings or defaul/input values, by default True
-
plot_sensitivity(sensitivity, pname='ap', pname2=None, pct=95, distorted=True, comp='both', rpow=0, save=None)[source]¶ Plot parameter sensitivities.
Plot the sensitivity to one parameter or the joint sensitivity to a pair of parameters. The resulting plot shows the partial derivatives of pname on the left-hand side and the distribution of the Fisher information for pname or, if pname2 is specified, (pname, pname2) on the right-hand side.
Parameters: - - dict (sensitivity) – Dictionary with keys nominal, partials and fisher, normally obtained by calling compute_sensitivity() on a VegaInterface object, then passing its sensitivity attribute here.
- - str (comp) – Name of the first parameter to use. Partial derivatives are only displayed for this parameter, even when pname2 is specified.
- - str or None (save) – Name of the second parameter to use. Displays the Fisher information associated with the covariance of (pname,pname2) when specified. If None, then use (pname,pname).
- - float (rpow) – Clip the color map for values above this percentile value.
- - bool (distorted) – Plot the sensitivity of the predicted correlation including the distortion matrix when True. Otherwise, use the undistorted correlation function model.
- - str – Which component of the signal model to display. Select either peak, smooth or both.
- - float – The power of the radial weight to use for plotting the partial derivatives of pname.
- - str or None – Save the produced plot a file with this name. When None, do not save the plot.
-
plot_wedge(ax, mu_bin, models=None, cov_mat=None, labels=None, data=None, cross_flag=False, corr_name='lyaxlya', models_only=False, data_only=False, data_label=None, no_postprocess=False, **kwargs)[source]¶ Plot a wedge into the input axes using the input mu_bin
Parameters: - ax (plt.axes) – Axes object to plot the wedge in
- wedge_obj (vega.Wedge) – Vega wedge object for computing the wedge
- models (List[array] or List[dict], optional) – List of models to plot, by default None
- cov_mat (array or dict, optional) – Covariance matrix as an array or a dictionary of components, by default None
- labels (List[str], optional) – List of labels for the models, by default None
- data (array or dict, optional) – Data vector as an array or a dictionary of components, by default None
- cross_flag (bool, optional) – Whether the wedge is for the cross-correlation, by default False
- corr_name (str, optional) – Name of the correlation component, by default ‘lyaxlya’
- models_only (bool, optional) – Whether to only plot models and ignore the data, by default False
- data_only (bool, optional) – Whether to only plot data and ignore the models, by default False
- data_label (str, optional) – Label for the data, by default None
-
postprocess_plot(ax, mu_bin=None, xlim=(0, 180), ylim=None, no_legend=False, title='mu_bin', legend_loc='best', legend_ncol=1, **kwargs)[source]¶ Add postprocessing to the plot on input axes
Parameters: - ax (plt.axes) – Axes object to postprocess
- mu_bin (array or tuple) – Array or tuple containing mu_min and mu_max of the wedge
- xlim (tuple, optional) – Limits of the x axis, by default (0, 180)