@@ -81,6 +81,8 @@ def pulls(
81
81
bestfit (np.ndarray): best-fit parameter results
82
82
uncertainty (np.ndarray): parameter uncertainties
83
83
labels (Union[List[str], np.ndarray]): parameter names
84
+ numeric Optional[Union[List[bool], np.ndarray]]: which parameters are numeric,
85
+ and should only be shown directly
84
86
figure_path (Optional[pathlib.Path], optional): path where figure should be
85
87
saved, or None to not save it, defaults to None
86
88
close_figure (bool, optional): whether to close each figure immediately after
@@ -94,7 +96,7 @@ def pulls(
94
96
numeric = np .zeros (num_pars , dtype = bool ) if numeric is None else np .asarray (numeric )
95
97
y_positions = np .arange (num_pars )[::- 1 ]
96
98
97
- fig , ax = plt .subplots (figsize = ( 6 , 1 + num_pars / 4 ), dpi = 100 )
99
+ fig , ax = plt .subplots ()
98
100
if num_pars > np .sum (numeric ): # Actual pulls
99
101
ax .errorbar (
100
102
np .ma .masked_array (bestfit , mask = numeric ),
@@ -120,7 +122,7 @@ def pulls(
120
122
zip (numeric [::- 1 ], bestfit [::- 1 ], uncertainty [::- 1 ])
121
123
):
122
124
if show :
123
- ax .text (0 , i , f "{ par :.2f} +- { unc :.2f} " , ha = "center" , va = "center" )
125
+ ax .text (0 , i , rf "{ par :.2f} $\pm$ { unc :.2f} " , ha = "center" , va = "center" )
124
126
125
127
ax .set_xlim ([- 3 , 3 ])
126
128
ax .set_xlabel (r"$\left(\hat{\theta} - \theta_0\right) / \Delta \theta$" )
0 commit comments