From 65db23c981b6164b5577baa7205c4edb93fec8ef Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 14 May 2019 11:35:01 -0700 Subject: [PATCH] don't treat the no data case differently --- adaptive/learner/learner1D.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/adaptive/learner/learner1D.py b/adaptive/learner/learner1D.py index 9e19912c8..608aa79ab 100644 --- a/adaptive/learner/learner1D.py +++ b/adaptive/learner/learner1D.py @@ -590,12 +590,11 @@ def plot(self): Plot of the evaluated data. """ hv = ensure_holoviews() - if not self.data: - p = hv.Scatter([]) * hv.Path([]) - elif not self.vdim > 1: - p = hv.Scatter(self.data) * hv.Path([]) + + xs, ys = zip(*sorted(self.data.items())) if self.data else ([], []) + if self.vdim == 1: + p = hv.Path([]) * hv.Scatter((xs, ys)) else: - xs, ys = zip(*sorted(self.data.items())) p = hv.Path((xs, ys)) * hv.Scatter([]) # Plot with 5% empty margins such that the boundary points are visible