Skip to content

Commit fafbbcf

Browse files
author
Enrico Bothmann
committed
Allow for using rebin_count as an arg to plot
1 parent f13e99f commit fafbbcf

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

heppyplotlib/plot.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,15 @@ def plot(filename_or_data_object, rivet_path,
5555
else:
5656
errors_enabled = True if errors_enabled is None else errors_enabled
5757

58-
if uses_rivet_plot_info:
59-
from . import rivetplot
60-
rebin_count = rivetplot.rebin_count(rivet_path)
58+
if "rebin_count" in kwargs:
59+
rebin_count = kwargs["rebin_count"]
60+
del kwargs["rebin_count"]
6161
else:
62-
rebin_count = 1
62+
if uses_rivet_plot_info:
63+
from . import rivetplot
64+
rebin_count = rivetplot.rebin_count(rivet_path)
65+
else:
66+
rebin_count = 1
6367

6468
result = yodaplot.plot(filename_or_data_object, rivet_path,
6569
errors_enabled=errors_enabled,
@@ -68,4 +72,4 @@ def plot(filename_or_data_object, rivet_path,
6872
if uses_rivet_plot_info:
6973
from . import rivetplot
7074
rivetplot.apply_plot_info(rivet_path)
71-
return result
75+
return result

0 commit comments

Comments
 (0)