Skip to content

Commit d26c800

Browse files
committed
Simplify plot_input example
1 parent 5def00a commit d26c800

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/plot_input.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,14 @@ def update_plot(frame):
6363
6464
"""
6565
global plotdata
66-
block = True # The first read from the queue is blocking ...
6766
while True:
6867
try:
69-
data = q.get(block=block)
68+
data = q.get_nowait()
7069
except queue.Empty:
7170
break
7271
shift = len(data)
7372
plotdata = np.roll(plotdata, -shift, axis=0)
7473
plotdata[-shift:, :] = data
75-
block = False # ... all further reads are non-blocking
7674
for column, line in enumerate(lines):
7775
line.set_ydata(plotdata[:, column])
7876
return lines

0 commit comments

Comments
 (0)