I run a script from the shell which does stuff in a loop and at the end of each loop plots some results updating the same matplotlib figure (calling update_plot
update_plot