Zooming into plot breaks real-time axis updating

Viewed 68

The x-axis of this real-time plot expands dynamically, which is good.

import numpy as np
import matplotlib.pyplot as plt

for i in range(1000):
    y = np.random.random()
    plt.scatter(i, y)
    plt.pause(0.05)

plt.show()

However, this dynamic expansion will stop working if I zoom into the plot using the magnifying glass icon, and then press the Home button to zoom back out.

How can I recover the dynamic x-axis after having manually zoomed in?

0 Answers
Related