diff --git a/adaptive/learner/learner1D.py b/adaptive/learner/learner1D.py index 9e19912c8..e6c9dbaa5 100644 --- a/adaptive/learner/learner1D.py +++ b/adaptive/learner/learner1D.py @@ -590,12 +590,10 @@ 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: + if self.vdim <= 1: p = hv.Scatter(self.data) * hv.Path([]) else: - xs, ys = zip(*sorted(self.data.items())) + xs, ys = zip(*sorted(self.data.items())) if self.data else ([], []) p = hv.Path((xs, ys)) * hv.Scatter([]) # Plot with 5% empty margins such that the boundary points are visible