Skip to content

Commit

Permalink
MPLRenderer.show allows passing in multiple objects
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 18, 2017
1 parent a24300d commit 79f7446
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions holoviews/plotting/mpl/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,23 @@ def show(self, obj):
GUI backend.
"""
if self.interactive:
if isinstance(obj, list):
return [self.get_plot(o) for o in obj]
return self.get_plot(obj)

from .plot import MPLPlot
MPLPlot._close_figures = False
try:
plot = self.get_plot(obj)
plt.show(plot.state)
plots = []
objects = obj if isinstance(obj, list) else [obj]
for o in obj:
plots.append(self.get_plot(o))
plt.show()
except:
MPLPlot._close_figures = True
raise
MPLPlot._close_figures = True
return plot
return plots[0] if len(plots) == 1 else plots


@classmethod
Expand Down

0 comments on commit 79f7446

Please sign in to comment.