ijazz.plotting ============== .. py:module:: ijazz.plotting Functions --------- .. autoapisummary:: ijazz.plotting.ijazz_plot_results ijazz.plotting.plot_results_from_json ijazz.plotting.plot_results_from_json2G ijazz.plotting.plot_syst_from_jsons ijazz.plotting.plot_sas_fit_results Module Contents --------------- .. py:function:: ijazz_plot_results() entry point for the ijazz_plot command .. py:function:: plot_results_from_json(json_file: Union[str, pathlib.Path, Dict], dims: List = None, x_range=(), x_unit='', cat_latex: Dict = None, resp_range=(), reso_range=(), hide_legend=False, jsons_mode='', param_to_plot=None, **kwargs) -> Tuple[List[matplotlib.pyplot.Figure], matplotlib.pyplot.Axes] Create a list of Axes to plot the results in the json file. the dimensions to plot can be specified, additional dimension are averaged over. Up to 3 dimensions can be plotted. :param json_file: json file containing the results of the IJazZ SAS fit or Dict from the json file :type json_file: Union[str, Path, Dict] :param dims: name dimensions to plot (as in the categories). Defaults to None. :type dims: List, optional :param x_range: range of the main variable (dimension 0). Defaults to (). :type x_range: tuple, optional :param x_unit: usint of the main varaible. Defaults to ''. :type x_unit: str, optional :param cat_latex: dictionnary mapping var name (from categories) into a latex name. Defaults to None. :type cat_latex: Dict, optional :param resp_range: y-range of the resp axis. Defaults to (). :type resp_range: tuple, optional :param reso_range: y-range if the reso axis. Defaults to (). :type reso_range: tuple, optional :param leg_ncol: number of columns in the legend. Defaults to 1. :type leg_ncol: int, optional :param hide_legend: hide the legend. Defaults to False. :type hide_legend: bool, optional :param jsons_mode: select plotting mode between 'compare' and 'ratio'. Defaults to ''. :type jsons_mode: str, optional :param param_to_plot: parameter to plot (resp or reso) if compare_jsons. Defaults to None. :type param_to_plot: str, optional :returns: Figure and Axes of the plot. :rtype: Tuple[Figure, Axes] .. py:function:: plot_results_from_json2G(json_file: Union[str, pathlib.Path, Dict], dims: List = None, x_range=(), x_unit='', cat_latex: Dict = None, mu_range=(0.78, 1.02), reso2_range=(-0.001, 0.1), frac_range=(0.78, 1.02), **kwargs) -> Tuple[List[matplotlib.pyplot.Figure], matplotlib.pyplot.Axes] Create a list of Axes to plot the results in the json file. the dimensions to plot can be specified, additional dimension are averaged over. Up to 3 dimensions can be plotted. :param json_file: json file containing the results of the IJazZ SAS fit or Dict from the json file :type json_file: Union[str, Path, Dict] :param dims: name dimensions to plot (as in the categories). Defaults to None. :type dims: List, optional :param x_range: range of the main variable (dimension 0). Defaults to (). :type x_range: tuple, optional :param x_unit: usint of the main varaible. Defaults to ''. :type x_unit: str, optional :param cat_latex: dictionnary mapping var name (from categories) into a latex name. Defaults to None. :type cat_latex: Dict, optional :param resp_range: y-range of the resp axis. Defaults to (). :type resp_range: tuple, optional :param reso_range: y-range if the reso axis. Defaults to (). :type reso_range: tuple, optional :param leg_ncol: number of columns in the legend. Defaults to 1. :type leg_ncol: int, optional :returns: Figure and Axes of the plot. :rtype: Tuple[Figure, Axes] .. py:function:: plot_syst_from_jsons(nominal: Union[Dict, str, pathlib.Path], syst_jsons: List[Union[Dict, str, pathlib.Path]], fit_2g: Union[Dict, str, pathlib.Path] = None, nominal_syst: Union[Dict, str, pathlib.Path] = None, scale_flat_syst: float = 0.0, smear_flat_syst: float = 0.0, **kwargs) -> Tuple[str, List[str]] Plot the contribution of each systematic uncertainties from the json files :param nominal: nominal json file :type nominal: Union[Dict, str, Path] :param syst_jsons: list of json files with systematic variations :type syst_jsons: List[Union[Dict, str, Path]] :param fit_2g: json file with the parameters of the double gaussian fit. Defaults to None. :type fit_2g: Union[Dict, str, Path], optional :param scale_flat_syst: flat scale systematic uncertainty. Defaults to 0.0. :type scale_flat_syst: float, optional :param smear_flat_syst: flat smear systematic uncertainty. Defaults to 0.0. :type smear_flat_syst: float, optional Returns: .. py:function:: plot_sas_fit_results(sas: ijazz.ScaleAndSmearing.IJazZSAS, cat_latex={}, x_range=None, resp_range=(0.95, 1.05), reso_range=(0, 0.05), add_injected=False, use_pt_cat=False, resp_range_ratio=(0.999, 1.001), reso_range_ratio=(0.8, 1.2), pt_scale_std=1.0) -> Tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes] Plot the result of the scale and smearing fit :param sas: object containing the fit result of the scale and smearing (as well as the data , mc samples) :type sas: IJazZSAS :param cat_latex: dict containing for each variable used for categorisation a latex plotting symbol (e.g. {'pt': 'p_T'}). Defaults to {}. :type cat_latex: dict, optional :param x_range: x axis range (can be auto). Defaults to None. :type x_range: tuple, optional :param resp_range: y axis range for response. Defaults to (0.95, 1.05). :type resp_range: tuple, optional :param reso_range: y axis range for resolution. Defaults to (0, 0.05). :type reso_range: tuple, optional :param add_injected: When a resolution was injected for test, plot the value (variable sas per lepton must exist filled with the injected s&s). Defaults to False. :type add_injected: bool, optional :param use_pt_cat: Use the pt categorisation axis (when fitting with relative pt, allows to plot back w/r to pt). Defaults to False. :type use_pt_cat: bool, optional :param resp_range_ratio: y axis range for response ratio. Defaults to (0.999, 1.001). :type resp_range_ratio: tuple, optional :param reso_range_ratio: y axis range for resolution ratio. Defaults to (0.80, 1.20). :type reso_range_ratio: tuple, optional :param pt_scale_std: ?. Defaults to 1.0. :type pt_scale_std: float, optional :returns: matplotlib figure, axes with the result :rtype: tuple[plt.Figure, plt.Axes]