test: txrx_hwloop: ESC closes matplotlib figure
This commit is contained in:
parent
12990df794
commit
22f5287714
1 changed files with 6 additions and 0 deletions
|
|
@ -24,6 +24,10 @@ import pandas as pd
|
|||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
def close_figure(event):
|
||||
if event.key == 'escape':
|
||||
plt.close()
|
||||
|
||||
data = pd.read_csv('samples.csv')
|
||||
I = data['I'].to_numpy()
|
||||
Q = data['Q'].to_numpy()
|
||||
|
|
@ -60,4 +64,6 @@ print(f" Variance: {var:.2f}")
|
|||
print(f" Std.Dev: {avg:.2f}")
|
||||
|
||||
fig.subplots_adjust(hspace=0.5)
|
||||
print(f"\nPress [Escape] to close figure")
|
||||
fig.canvas.mpl_connect('key_press_event', close_figure)
|
||||
plt.show()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue