src/graphnet/pisa/plotting.py
def plot_1D_contour(
    contour_data, chi2_critical_value=2.706, width=2 * 3.176, height=2.388
):
    """Plots 1D contours from GraphNeT PISA fits.

    Args:
        contour_data (list): list of  dictionaries with plotting information. Format is for each dictionary is: {'path':path_to_pisa_fit_result, 'model': 'name_of_my_model_in_fit'}. One can specify optional fields in the dictionary: "label" - the legend label, "color" - the color of the contour, "linestyle" - the style of the contour line.
        chi2_critical_value (float, optional): The critical value of the chi2 fits. Defaults to 2.706 (90% CL).
        width (float, optional): width of figure in inches. Defaults to 2*3.176.
        height (float, optional): height of figure in inches. Defaults to 2.388.

    Returns:
        matplotlib.pyplot.figure: the figure with contours
    """
    variables = ["theta23_fixed", "dm31_fixed"]
    fig, ax = plt.subplots(
        1, 2, figsize=(width, height), constrained_layout=True
    )
    ls = 0
    for entry in contour_data:
        entry_data, model_name, label, ls, color = read_entry(entry)
        for variable in variables:
            model_idx = entry_data["model"] == model_name
            padding_idx = entry_data[variable] != -1
            chi2_idx = entry_data["mod_chi2"] < chi2_critical_value
            model_data = entry_data.loc[
                (model_idx) & (padding_idx) & (chi2_idx), :
            ]
            x = model_data.sort_values(variable)
            if variable == "theta23_fixed":
                ax[0].set_ylabel("$\\chi^2$", fontsize=12)
                ax[0].plot(
                    np.sin(np.deg2rad(x[variable])) ** 2,
                    x["mod_chi2"],
                    color=color,
                    label=label,
                    ls=ls,
                )
                ax[0].set_xlabel("$\\sin(\\theta_{23})^2$", fontsize=12)
            elif variable == "dm31_fixed":
                ax[1].plot(
                    x[variable], x["mod_chi2"], color=color, label=label, ls=ls
                )
                ax[1].ticklabel_format(axis="x", style="sci", scilimits=(0, 0))
                ax[1].set_xlabel("$\\Delta m_{31}^2 [eV^2]$", fontsize=12)
    h = [item.get_text() for item in ax[1].get_yticklabels()]
    empty_string_labels = [""] * len(h)
    ax[1].set_yticklabels(empty_string_labels)
    ax[0].set_ylim(0, chi2_critical_value)
    ax[1].set_ylim(0, chi2_critical_value)
    ax[0].legend()
    return fig
Plots 1D contours from GraphNeT PISA fits.

    Args:
        contour_data (list): list of  dictionaries with plotting information. Format is for each dictionary is: {'path':path_to_pisa_fit_result, 'model': 'name_of_my_model_in_fit'}. One can specify optional fields in the dictionary: "label" - the legend label, "color" - the color of the contour, "linestyle" - the style of the contour line.
        chi2_critical_value (float, optional): The critical value of the chi2 fits. Defaults to 2.706 (90% CL).
        width (float, optional): width of figure in inches. Defaults to 2*3.176.
        height (float, optional): height of figure in inches. Defaults to 2.388.

    Returns:
        matplotlib.pyplot.figure: the figure with contours
    
Plots 1D contours from GraphNeT PISA fits.
Plots 1D contours from GraphNeT PISA fits .
def plot_1D_contour(
    contour_data, chi2_critical_value=2.706, width=2 * 3.176, height=2.388
):
    variables = ["theta23_fixed", "dm31_fixed"]
    fig, ax = plt.subplots(
        1, 2, figsize=(width, height), constrained_layout=True
    )
    ls = 0
    for entry in contour_data:
        entry_data, model_name, label, ls, color = read_entry(entry)
        for variable in variables:
            model_idx = entry_data["model"] == model_name
            padding_idx = entry_data[variable] != -1
            chi2_idx = entry_data["mod_chi2"] < chi2_critical_value
            model_data = entry_data.loc[
                (model_idx) & (padding_idx) & (chi2_idx), :
            ]
            x = model_data.sort_values(variable)
            if variable == "theta23_fixed":
                ax[0].set_ylabel("$\\chi^2$", fontsize=12)
                ax[0].plot(
                    np.sin(np.deg2rad(x[variable])) ** 2,
                    x["mod_chi2"],
                    color=color,
                    label=label,
                    ls=ls,
                )
                ax[0].set_xlabel("$\\sin(\\theta_{23})^2$", fontsize=12)
            elif variable == "dm31_fixed":
                ax[1].plot(
                    x[variable], x["mod_chi2"], color=color, label=label, ls=ls
                )
                ax[1].ticklabel_format(axis="x", style="sci", scilimits=(0, 0))
                ax[1].set_xlabel("$\\Delta m_{31}^2 [eV^2]$", fontsize=12)
    h = [item.get_text() for item in ax[1].get_yticklabels()]
    empty_string_labels = [""] * len(h)
    ax[1].set_yticklabels(empty_string_labels)
    ax[0].set_ylim(0, chi2_critical_value)
    ax[1].set_ylim(0, chi2_critical_value)
    ax[0].legend()
    return fig
def plot_1D_contour ( contour_data , chi2_critical_value = 2.706 , width = 2 * 3.176 , height = 2.388 ) : variables = [ "theta23_fixed" , "dm31_fixed" ] fig , ax = plt . subplots ( 1 , 2 , figsize = ( width , height ) , constrained_layout = True ) ls = 0 for entry in contour_data : entry_data , model_name , label , ls , color = read_entry ( entry ) for variable in variables : model_idx = entry_data [ "model" ] == model_name padding_idx = entry_data [ variable ] != - 1 chi2_idx = entry_data [ "mod_chi2" ] < chi2_critical_value model_data = entry_data . loc [ ( model_idx ) & ( padding_idx ) & ( chi2_idx ) , : ] x = model_data . sort_values ( variable ) if variable == "theta23_fixed" : ax [ 0 ] . set_ylabel ( "$\\chi^2$" , fontsize = 12 ) ax [ 0 ] . plot ( np . sin ( np . deg2rad ( x [ variable ] ) ) ** 2 , x [ "mod_chi2" ] , color = color , label = label , ls = ls , ) ax [ 0 ] . set_xlabel ( "$\\sin(\\theta_{23})^2$" , fontsize = 12 ) elif variable == "dm31_fixed" : ax [ 1 ] . plot ( x [ variable ] , x [ "mod_chi2" ] , color = color , label = label , ls = ls ) ax [ 1 ] . ticklabel_format ( axis = "x" , style = "sci" , scilimits = ( 0 , 0 ) ) ax [ 1 ] . set_xlabel ( "$\\Delta m_{31}^2 [eV^2]$" , fontsize = 12 ) h = [ item . get_text ( ) for item in ax [ 1 ] . get_yticklabels ( ) ] empty_string_labels = [ "" ] * len ( h ) ax [ 1 ] . set_yticklabels ( empty_string_labels ) ax [ 0 ] . set_ylim ( 0 , chi2_critical_value ) ax [ 1 ] . set_ylim ( 0 , chi2_critical_value ) ax [ 0 ] . legend ( ) return fig
Plots 1D contours from GraphNeT PISA fits.
Plots 1D contours from GraphNeT PISA fits .
"""Plots 1D contours from GraphNeT PISA fits.

    Args:
        contour_data (list): list of  dictionaries with plotting information. Format is for each dictionary is: {'path':path_to_pisa_fit_result, 'model': 'name_of_my_model_in_fit'}. One can specify optional fields in the dictionary: "label" - the legend label, "color" - the color of the contour, "linestyle" - the style of the contour line.
        chi2_critical_value (float, optional): The critical value of the chi2 fits. Defaults to 2.706 (90% CL).
        width (float, optional): width of figure in inches. Defaults to 2*3.176.
        height (float, optional): height of figure in inches. Defaults to 2.388.

    Returns:
        matplotlib.pyplot.figure: the figure with contours
    """
the figure with contours
the figure with contours
matplotlib.pyplot.figure
contour_data
list of  dictionaries with plotting information. Format is for each dictionary is: {'path':path_to_pisa_fit_result, 'model': 'name_of_my_model_in_fit'}. One can specify optional fields in the dictionary: "label" - the legend label, "color" - the color of the contour, "linestyle" - the style of the contour line.
list of dictionaries with plotting information . Format is for each dictionary is : { ' path ' : path_to_pisa_fit_result ' model ' : ' name_of_my_model_in_fit ' } . One can specify optional fields in the dictionary : " label " - the legend label " color " - the color of the contour " linestyle " - the style of the contour line .
chi2_critical_value
The critical value of the chi2 fits.
The critical value of the chi2 fits .
2.706 (90% CL)
width
width of figure in inches.
width of figure in inches .
2*3.176
height
height of figure in inches.
height of figure in inches .
2.388