From d977646ecbe9f00d3fcda453683ebdfcddb73c04 Mon Sep 17 00:00:00 2001 From: Nitish Pasricha Date: Thu, 30 Jan 2020 18:47:41 +0530 Subject: [PATCH] Integrate point estimate posterior plot (#1038) * integrated point_estimate in plot_posterior * changelog update * lint and changelog update --- CHANGELOG.md | 1 + arviz/plots/posteriorplot.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa50c73bdd..6b472923b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * Rename flat_inference_data_to_dict (#1003) * Violinplot: fix histogram (#997) * Convert all instances of SyntaxWarning to UserWarning (#1016) +* Fix `point_estimate` in `plot_posterior` (#1038) ### Deprecation diff --git a/arviz/plots/posteriorplot.py b/arviz/plots/posteriorplot.py index e68428347c..b206e80f6f 100644 --- a/arviz/plots/posteriorplot.py +++ b/arviz/plots/posteriorplot.py @@ -188,6 +188,11 @@ def plot_posterior( if not 1 >= credible_interval > 0: raise ValueError("The value of credible_interval should be in the interval (0, 1]") + if point_estimate == "auto": + point_estimate = rcParams["plot.point_estimate"] + elif point_estimate not in {"mean", "median", "mode", None}: + raise ValueError("The value of point_estimate must be either mean, median, mode or None.") + plotters = filter_plotters_list( list(xarray_var_iter(get_coords(data, coords), var_names=var_names, combined=True)), "plot_posterior",