Updating matplotlib version likely solves tkinter plot_canvas.draw() threading issue

This commit is contained in:
2023-02-24 11:40:25 +01:00
parent ae71a8d31b
commit c0fb152efa
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ appdirs==1.4.4
cycler==0.10.0
future==0.18.2
kiwisolver==1.3.2
matplotlib==3.3.4
matplotlib==3.7.0
# numpy==1.19.3 ## do not include versioning to avoid versioning conflict
pandas==1.1.5
Pillow==8.4.0
+4 -4
View File
@@ -99,8 +99,8 @@ class ExecCSVThread(Thread):
try:
for j in range(4):
avx_lines[j].set_data([t, t], [0, 1])
print("The next line might crash the programm, outcomment if necessary")
#parent.plot_canvas.draw() # equivalent to matplotlib.show()
#print("The next line might crash the programm, outcomment if necessary")
parent.plot_canvas.draw() # equivalent to matplotlib.show()
except DeviceAccessError as e:
ui_print("Failed to update figure: ", e)
@@ -192,8 +192,8 @@ def display_plot(parent): # create plot of fixed size (pixels) from array
axes[2].axvline(x=0, color="r"), axes[3].axvline(x=0, color="r")]
# Show new plot
parent.plot_canvas = FigureCanvasTkAgg(figure, parent.plot_frame) # create canvas to draw figure on
print("The next line might crash the programm, outcomment if necessary")
#parent.plot_canvas.draw() # equivalent to matplotlib.show()
#print("The next line might crash the programm, outcomment if necessary")
parent.plot_canvas.draw() # equivalent to matplotlib.show()
parent.plot_canvas.get_tk_widget().grid(row=0, column=0, sticky="nesw") # place canvas in the UI
return figure, avx_lines