@@ -53,6 +53,7 @@ def plot_recovery(
5353 n_row = None ,
5454 xlabel = "Ground truth" ,
5555 ylabel = "Estimated" ,
56+ ** kwargs
5657):
5758 """Creates and plots publication-ready recovery plot with true vs. point estimate + uncertainty.
5859 The point estimate can be controlled with the ``point_agg`` argument, and the uncertainty estimate
@@ -106,6 +107,9 @@ def plot_recovery(
106107 The label on the x-axis of the plot
107108 ylabel : str, optional, default: 'Estimated'
108109 The label on the y-axis of the plot
110+ **kwargs : optional
111+ Additional keyword arguments passed to ax.errorbar or ax.scatter.
112+ Example: `rasterized=True` to reduce PDF file size with many dots
109113
110114 Returns
111115 -------
@@ -156,9 +160,9 @@ def plot_recovery(
156160
157161 # Add scatter and error bars
158162 if uncertainty_agg is not None :
159- _ = ax .errorbar (prior_samples [:, i ], est [:, i ], yerr = u [:, i ], fmt = "o" , alpha = 0.5 , color = color )
163+ _ = ax .errorbar (prior_samples [:, i ], est [:, i ], yerr = u [:, i ], fmt = "o" , alpha = 0.5 , color = color , ** kwargs )
160164 else :
161- _ = ax .scatter (prior_samples [:, i ], est [:, i ], alpha = 0.5 , color = color )
165+ _ = ax .scatter (prior_samples [:, i ], est [:, i ], alpha = 0.5 , color = color , ** kwargs )
162166
163167 # Make plots quadratic to avoid visual illusions
164168 lower = min (prior_samples [:, i ].min (), est [:, i ].min ())
0 commit comments