Python, Matplotlib, Animation, Statistics, Code.
t < xmin: ax.set_xlim(1.1*xmin, 1.1*xmax) ax.figure.canvas.draw() if y <= ymin: ax.set_ylim(1.1*ymin, 1.1*ymax) ax.figure.canvas.draw() if t >= ymax: ax.set_ylim(1.1*ymin, 1.1*ymax) ax.figure.canvas.draw() def run_animation(num, data, line): xmin, xmax = ax.get_xlim() ymin, ymax = ax.get_ylim()