Skip to content

Commit 65db23c

Browse files
committed
don't treat the no data case differently
1 parent f268f0d commit 65db23c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

adaptive/learner/learner1D.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,11 @@ def plot(self):
590590
Plot of the evaluated data.
591591
"""
592592
hv = ensure_holoviews()
593-
if not self.data:
594-
p = hv.Scatter([]) * hv.Path([])
595-
elif not self.vdim > 1:
596-
p = hv.Scatter(self.data) * hv.Path([])
593+
594+
xs, ys = zip(*sorted(self.data.items())) if self.data else ([], [])
595+
if self.vdim == 1:
596+
p = hv.Path([]) * hv.Scatter((xs, ys))
597597
else:
598-
xs, ys = zip(*sorted(self.data.items()))
599598
p = hv.Path((xs, ys)) * hv.Scatter([])
600599

601600
# Plot with 5% empty margins such that the boundary points are visible

0 commit comments

Comments
 (0)