Fix showing graph
This commit is contained in:
@@ -9,11 +9,20 @@ class Viewer:
|
||||
|
||||
plt.xlabel("Pixel")
|
||||
plt.ylabel("Tension (V)")
|
||||
plt.legend()
|
||||
# plt.legend()
|
||||
plt.ylim(0, 3.4)
|
||||
|
||||
x = np.arange(1, len(data) + 1)
|
||||
|
||||
plt.plot(x, data, label="Intensity")
|
||||
# plt.draw()
|
||||
|
||||
self.show()
|
||||
self.pause()
|
||||
|
||||
def show(self) -> None:
|
||||
plt.show()
|
||||
plt.ion()
|
||||
plt.show(block=False)
|
||||
|
||||
def pause(self, secs: float = 0.001) -> None:
|
||||
plt.pause(secs)
|
||||
Reference in New Issue
Block a user