From 687fdabbc086375c59fe28bdc8f49e2a14c66de0 Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Fri, 13 Apr 2018 17:17:24 -0700 Subject: [PATCH] split plotting behaviour across windows and notwindows --- tools/odrive/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/odrive/utils.py b/tools/odrive/utils.py index 6b20cbd3..af54cf3c 100755 --- a/tools/odrive/utils.py +++ b/tools/odrive/utils.py @@ -65,9 +65,10 @@ def start_liveplotter(get_var_callback): while not cancellation_token.is_set(): plt.clf() plt.plot(vals) - #time.sleep(1/plot_rate) - fig.canvas.flush_events() - plt.pause(1/plot_rate) + if platform.system() == "Windows": + plt.pause(1/plot_rate) + else: + fig.canvas.flush_events() threading.Thread(target=fetch_data).start() threading.Thread(target=plot_data).start()