Skip to content

Commit

Permalink
don't treat the no data case differently
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed May 15, 2019
1 parent f268f0d commit 65db23c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions adaptive/learner/learner1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65db23c

Please sign in to comment.