From 71088ffb9c3e67f8ec146f7e5e32c6a1c2774341 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Mon, 25 Jun 2018 18:53:13 -0700 Subject: [PATCH] fix pause focus stealing --- tools/odrive/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/odrive/utils.py b/tools/odrive/utils.py index bc466f9c..0f5c58b8 100755 --- a/tools/odrive/utils.py +++ b/tools/odrive/utils.py @@ -69,10 +69,8 @@ def start_liveplotter(get_var_callback): while not cancellation_token.is_set(): plt.clf() plt.plot(vals) - if platform.system() == "Windows": - plt.pause(1/plot_rate) - else: - fig.canvas.flush_events() + fig.canvas.draw() + fig.canvas.start_event_loop(1/plot_rate) threading.Thread(target=fetch_data).start() threading.Thread(target=plot_data).start()