I'm using Canopy in a Win7 machine, with %pylab
enabled and interactive(Qt4) as backend. IMHO, I'm getting what I consider a weird behavior of matplotlib
.
If the code is executed line by line, the frames for the graphs appear as I expect, but not the content of the graphs themselves. If, after the plotting, I need information regarding to those graphs, as I can't see them, I can't answer properly. Once I answer the question with a dummy answer, the graphs appear.
What I would like to achieve is that the graphs show before the question would be asked, in order to have the information to reply.
Thanks in advance.
This is a MWE
import numpy as np
import matplotlib.pyplot as plt
N = 8
y = np.zeros(N)
x1 = np.linspace(0, 10, N, endpoint=True)
x2 = np.linspace(0, 10, N, endpoint=False)
plt.figure()
plt.plot(x1, y, 'o')
plt.plot(x2, y + 0.5, 'o')
plt.ylim([-0.5, 1])
plt.show()
y1 = np.random.random(8)
plt.figure()
plt.plot(x1, y1)
plt.show()
dummy = raw_input("What is the third point in the second graph?")
EDIT: If I change the backend in Canopy from interactive(Qt4) to interactive(wx), it works as expected.