On 4/4/2010 3:15 AM, Enzo Michelangeli wrote:
> ion() doesn't do what I need: it just forces a draw()
> after every pyplot command allowing animated plots. Instead, I want the program
> to draw and show a complete plot, then pause allowing me to interact with its
> window (e.g., to pan, zoom and/or save a screenshot), then, after I close that
> window, proceed to build a new, entirely different plot, show it in a new window
> and so on.
>
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
for _ in range(3):
data = np.random.randint(0, 9,(4,))
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.plot(data)
raw_input("Hit Enter to continue")
hth,
Alan Isaac
|