For most mathematical coding, I use this website and their services as they offer examples for every subject and their support is super helpful:
https://labdeck.com/application-examples-screenshots/
If your want you graph to change by a variable amount then the code you want to use is
import matplotlib.pyplot as plt import time vec1=[1, 2, 3, 4, 5] vec2py=[10, 12, 9, 11, 13] plt.show() axes = plt.gca() axes.set_xlim(0, 6) axes.set_ylim(5, 50) plt.xlabel('x - axis') plt.ylabel('y - axis') plt.title('Example 1') plt.grid() line,= axes.plot(vec1,vec2py,color='red',lw=1) for x in range(0,10): vec2py = [x + 2 for x in vec2py] line.set_ydata(vec2py) plt.draw() plt.pause(1e-17) time.sleep(0.5) plt.show() You will have to change x for how many iterations of the graph you want and how long you want it to run for and also the +2 in the vec2py line for what variable amount you want to change it by. Naturally the code is a template and you can make any aesthetical changes. This code file is found under displaying dynamic graphs which is under python programming in the link above.
If you want to display a constant rely of information from a source, I'm not to sure how to do that but the website mention before does have an example, however it isn't in python but in a simplified form of C++.If you do want to see it then the link is https://labdeck.com/examples/dsp-ecg-processing/ecg-9-leads-graphs.pdf?01a96f&01a96f and its under ECG 9 Leads graphs in ECG on the link at the start. The graph can be shown as in a document or independently from the document.
I hopePS this helpsis for people who have the same question but not necessarily the same scenario as I think this question still hasn't been answeredwill help more.