diff --git a/fosdem_video_progress.py b/fosdem_video_progress.py index ceed713..1c06c1b 100755 --- a/fosdem_video_progress.py +++ b/fosdem_video_progress.py @@ -40,6 +40,10 @@ def main(): else: print("New time series.") ts = TimeSeries(states=set(), jobstates=set(), data=dict()) + + plt.ion() + plt.clf() + plt.show(block=False) while True: time, states, jobstates = get_data() @@ -56,8 +60,6 @@ def main(): print('pickle saved') # Show the plot - plt.close() - plt.clf() x = sorted(ts.data.keys()) # times states = sorted(ts.states) ys = [tuple(ts.data[time][0].get(state, 0) for state in states) for time in x] # numbers per state @@ -67,7 +69,6 @@ def main(): plt.stackplot(x, ys, labels=states) plt.legend(loc='upper left') print('showing plot') - plt.show(block=False) plt.pause(poll_rate)