how to make real time figure in python