From 3ed6ead65a9c83514474756eeba427115a4efb2f Mon Sep 17 00:00:00 2001 From: jacoterh <54140851+jacoterh@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:05:35 +0000 Subject: [PATCH] supporting quadratics --- docs/source/report/running.md | 10 ++++++++++ src/smefit/analyze/fisher.py | 19 ++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/docs/source/report/running.md b/docs/source/report/running.md index a07a5993..a6ed863a 100644 --- a/docs/source/report/running.md +++ b/docs/source/report/running.md @@ -168,6 +168,16 @@ fisher: figsize: [11, 15] # figure size title: true # if True display the fit label as title + plot: + summary_only: True # if True display only the fisher information per dataset group. If False will show the fine grained dataset per dataset + figsize: [11, 15] # figure size + title: true # if True display the fit label as title + column_names: # list of column names to be displayed, default is all + - group_1: "$\\rm group\\:1$" + - tt13: "$t\\bar{t}$" + - ... + together: ["fit_1", "fit_2"] # list of result IDs to be plotted together + ``` Finally the user has to specify two dictionaries where the informaions about diff --git a/src/smefit/analyze/fisher.py b/src/smefit/analyze/fisher.py index 70212f93..3059560b 100644 --- a/src/smefit/analyze/fisher.py +++ b/src/smefit/analyze/fisher.py @@ -553,6 +553,9 @@ def plot_heatmap( ] else: fisher_dfs = [fisher_df[latex_names.index.get_level_values(level=1)]] + quad_fisher_dfs = [ + quad_fisher_df[latex_names.index.get_level_values(level=1)] + ] # reshuffle column name ordering if column_names is not None: @@ -587,24 +590,26 @@ def plot_heatmap( latex_names, x_labels, ) - # ax.set_title(r"\rm Linear", fontsize=20, y=-0.08) + ax.set_title(r"\rm Linear", fontsize=20, y=-0.08) cax1 = make_axes_locatable(ax).append_axes("right", size="5%", pad=0.5) colour_bar = fig.colorbar(mpl.cm.ScalarMappable(norm=norm, cmap=cmap), cax=cax1) if quad_fisher_df is not None: ax = fig.add_subplot(122) - cax = ax.matshow(quad_fisher_df.values.T, cmap=cmap, norm=norm) - self.plot_values(ax, [quad_fisher_df], cmap, norm) + self.plot_values(ax, quad_fisher_dfs, cmap, norm) + self.set_ticks( ax, - np.arange(quad_fisher_df.shape[1]), - np.arange(quad_fisher_df.shape[0]), + np.arange(quad_fisher_dfs[0].shape[1]), + np.arange(quad_fisher_dfs[0].shape[0]), latex_names, x_labels, ) ax.set_title(r"\rm Quadratic", fontsize=20, y=-0.08) - cax1 = make_axes_locatable(ax).append_axes("right", size="10%", pad=0.1) - colour_bar = fig.colorbar(cax, cax=cax1) + cax1 = make_axes_locatable(ax).append_axes("right", size="5%", pad=0.5) + colour_bar = fig.colorbar( + mpl.cm.ScalarMappable(norm=norm, cmap=cmap), cax=cax1 + ) fig.subplots_adjust(top=0.9)