summaryrefslogtreecommitdiff
path: root/examples/plot_input.py
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2017-02-04 13:31:52 +0100
committerMatthias Geier <Matthias.Geier@gmail.com>2017-02-04 13:31:52 +0100
commitd26c8008d2a52f54426a1bdd965cfac037dfd482 (patch)
treec14f879357e4ce01c55e439a01e6c418f1636326 /examples/plot_input.py
parent5def00ade73156dfd2ec3da155262825494a644b (diff)
Simplify plot_input example
Diffstat (limited to 'examples/plot_input.py')
-rwxr-xr-xexamples/plot_input.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/plot_input.py b/examples/plot_input.py
index 5a105f4..88eb99f 100755
--- a/examples/plot_input.py
+++ b/examples/plot_input.py
@@ -63,16 +63,14 @@ def update_plot(frame):
"""
global plotdata
- block = True # The first read from the queue is blocking ...
while True:
try:
- data = q.get(block=block)
+ data = q.get_nowait()
except queue.Empty:
break
shift = len(data)
plotdata = np.roll(plotdata, -shift, axis=0)
plotdata[-shift:, :] = data
- block = False # ... all further reads are non-blocking
for column, line in enumerate(lines):
line.set_ydata(plotdata[:, column])
return lines