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 Apr 8, 2017
1 parent 86bee49 commit 986cdf3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions holoviews/plotting/mpl/renderer.py
Expand Up @@ -121,18 +121,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 986cdf3

Please sign in to comment.