I need your help to write a script in Python that will take dynamically changed data, the source of data is not matter here, and display graph on the screen.
I know how
I had the need to create a graph that updates with time. The most convenient solution I came up was to create a new graph each time. The issue was that the script won't be executed after the first graph is created, unless the window is closed manually. That issue was avoided by turning the interactive mode on as shown below
for i in range(0,100):
fig1 = plt.figure(num=1,clear=True) # a figure is created with the id of 1
createFigure(fig=fig1,id=1) # calls a function built by me which would insert data such that figure is 3d scatterplot
plt.ion() # this turns the interactive mode on
plt.show() # create the graph
plt.pause(2) # pause the script for 2 seconds , the number of seconds here determine the time after that graph refreshes
There are two important points to note here