diff --git a/compare.py b/compare.py index 2681dca9eab02af293a93d3d821229c8dce12ba5..cfe29df3fbd35fd8fa19edc6f2e8cc5c5ce886d4 100755 --- a/compare.py +++ b/compare.py @@ -21,6 +21,7 @@ def overlay_ROC(filename, *projects, **kwargs): plot_thresholds = kwargs.pop("plot_thresholds", False) threshold_log = kwargs.pop("threshold_log", True) lumifactor = kwargs.pop("lumifactor", None) + tight_layout = kwargs.pop("tight_layout", False) if kwargs: raise KeyError("Unknown kwargs: {}".format(kwargs)) @@ -57,9 +58,9 @@ def overlay_ROC(filename, *projects, **kwargs): if lumifactor is not None: sumw_b = p.w_test[p.y_test==0].sum()*lumifactor sumw_s = p.w_test[p.y_test==1].sum()*lumifactor - ax_abs_b.plot(tpr, (1.-fpr)*sumw_b, "r--", alpha=0.5) + ax_abs_b.plot(tpr, (1.-fpr)*sumw_b, alpha=0) ax_abs_b.invert_yaxis() - ax_abs_s.plot(tpr*sumw_s, fpr, "g--", alpha=0.5) + ax_abs_s.plot(tpr*sumw_s, fpr, alpha=0) if xlim is not None: ax.set_xlim(*xlim) @@ -79,7 +80,7 @@ def overlay_ROC(filename, *projects, **kwargs): ax.set_title('Receiver operating characteristic') ax.set_ylabel("Background rejection") ax.set_xlabel("Signal efficiency") - if plot_thresholds: + if plot_thresholds or tight_layout: # to fit right y-axis description fig.tight_layout() return save_show(plt, fig, filename)