From b2040c4bab8437939d62deab0f31a3014856c84d Mon Sep 17 00:00:00 2001 From: NateSchoolfield Date: Tue, 2 Feb 2021 14:40:02 -0800 Subject: [PATCH] Added maximize parameter --- bluesleep.py | 2 +- sleepdata.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bluesleep.py b/bluesleep.py index 13aafc6..fb51f49 100755 --- a/bluesleep.py +++ b/bluesleep.py @@ -120,7 +120,7 @@ if __name__ == "__main__": connect() threading.Thread(target=start_data_pull).start() threading.Thread(target=start_vibration).start() - sleepdata.init_graph() + sleepdata.init_graph(maximize=True) diff --git a/sleepdata.py b/sleepdata.py index 71722d4..8991444 100644 --- a/sleepdata.py +++ b/sleepdata.py @@ -36,8 +36,6 @@ csv_filename_format = '{}_{}.csv' plt.style.use('dark_background') graph_figure = plt.figure() graph_figure.canvas.set_window_title('blesleep') -figure_manager = plt.get_current_fig_manager() -figure_manager.full_screen_toggle() graph_axes = graph_figure.add_subplot(1, 1, 1) graph_data = {} @@ -241,7 +239,10 @@ def graph_animation(i): plt.legend() -def init_graph(): +def init_graph(maximize=False): + if maximize: + figure_manager = plt.get_current_fig_manager() + figure_manager.full_screen_toggle() ani = animation.FuncAnimation(graph_figure, graph_animation, interval=1000) plt.show()