Initial commit
This commit is contained in:
19
tcd1304_viewer/viewer.py
Normal file
19
tcd1304_viewer/viewer.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
|
||||
class Viewer:
|
||||
|
||||
def update_data(self, data: np.array) -> None:
|
||||
plt.clf()
|
||||
|
||||
plt.xlabel("Pixel")
|
||||
plt.ylabel("Tension (V)")
|
||||
plt.legend()
|
||||
|
||||
x = np.arange(1, len(data) + 1)
|
||||
|
||||
plt.plot(x, data, label="Intensity")
|
||||
|
||||
def show(self) -> None:
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user