Skip to content

Commit 251b280

Browse files
committed
plot_recording: only plot if something was recorded
1 parent 01f89c8 commit 251b280

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

examples/plot_recording.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848

4949
print('Input overflows during recording:', action.stats.input_overflows)
5050

51-
plt.plot(t, buffer)
52-
plt.xlabel('Time / seconds')
53-
plt.show()
51+
if len(buffer):
52+
plt.plot(t, buffer)
53+
plt.xlabel('Time / seconds')
54+
plt.show()
55+
else:
56+
print('Nothing was recorded.')

0 commit comments

Comments
 (0)