Skip to content

Commit

Permalink
Make forced plotting optional for coroutine case
Browse files Browse the repository at this point in the history
  • Loading branch information
tfarago committed Nov 11, 2014
1 parent 8f93f50 commit e316f3e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions concert/ext/viewers.py
Expand Up @@ -191,11 +191,13 @@ class PyplotViewer(PyplotViewerBase):
"""

def __init__(self, style="o", plot_kwargs=None, autoscale=True, title=""):
def __init__(self, style="o", plot_kwargs=None, autoscale=True, title="",
coroutine_force=False):
super(PyplotViewer, self).__init__(self._plot_unraveled)
self._autoscale = autoscale
self._style = style
self._iteration = 0
self.coroutine_force = coroutine_force
self._set_updater(_PyplotUpdater(self._queue, style,
plot_kwargs, autoscale,
title=title))
Expand Down Expand Up @@ -228,7 +230,7 @@ def plot(self, x, y=None, force=False):

def _plot_unraveled(self, item):
"""Unravel the *item* for x and y so that it is plotted correctly."""
self.plot(item[0], y=item[1])
self.plot(item[0], y=item[1], force=self.coroutine_force)

@property
def style(self):
Expand Down

0 comments on commit e316f3e

Please sign in to comment.