From 01b2fbd86f7c112577ea7178974d8fa497217b48 Mon Sep 17 00:00:00 2001 From: aloctavodia Date: Thu, 30 Jan 2020 16:45:08 -0300 Subject: [PATCH 1/2] ensure interpolation for plot_hpd always works --- arviz/plots/hpdplot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arviz/plots/hpdplot.py b/arviz/plots/hpdplot.py index fb3c337d29..0673939dce 100644 --- a/arviz/plots/hpdplot.py +++ b/arviz/plots/hpdplot.py @@ -102,7 +102,8 @@ def plot_hpd( smooth_kwargs = {} smooth_kwargs.setdefault("window_length", 55) smooth_kwargs.setdefault("polyorder", 2) - x_data = np.linspace(x.min(), x.max(), 200) + eps = np.finfo(float).eps + x_data = np.linspace(x.min() + eps, x.max() - eps, 200) hpd_interp = griddata(x, hpd_, x_data) y_data = savgol_filter(hpd_interp, axis=0, **smooth_kwargs) else: From b5effda70d488a7d03fc336f6762442c273be815 Mon Sep 17 00:00:00 2001 From: aloctavodia Date: Sun, 2 Feb 2020 16:29:40 -0300 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b472923b9..d5e9abfc28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ * Violinplot: fix histogram (#997) * Convert all instances of SyntaxWarning to UserWarning (#1016) * Fix `point_estimate` in `plot_posterior` (#1038) +* Fix interpolation `hpd_plot` (#1039) ### Deprecation