Skip to content

Commit

Permalink
Integrate point estimate posterior plot (#1038)
Browse files Browse the repository at this point in the history
* integrated point_estimate in plot_posterior

* changelog update

* lint and changelog update
  • Loading branch information
nitishp25 authored Jan 30, 2020
1 parent 65110fe commit d977646
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions arviz/plots/posteriorplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d977646

Please sign in to comment.