From past experience and the http://matplotlib.org/users/shell.html page, my understanding is I should use the TkAgg backend. I'm finding that TkAgg isn't updating plots in matplotlib 1.5.1 or 1.5.0, whereas it was in matplotlib 1.4.3. I am running this script:
import time
import matplotlib as mpl
print mpl.__version__
mpl.rcParams['backend'] = 'TkAgg'
import matplotlib.pyplot as plt
plt.ion()
plt.figure(3)
for xx in range(3):
plt.ioff()
plt.plot([1,3,34],[3,4+xx,3])
plt.draw()
plt.ion()
print "sleeping 1 sec"
time.sleep(1)
and under 1.4.3, I get a new line added to the plot each second, whereas in 1.5.1, the figure shows, but no plot is drawn. It should be the former shouldn't it? Or is something wrong with my use of ioff/draw/ion, or is there some other way to do this that will work with matplotlib 1.5.1?
My environment is linux red hat 7, python 2.7.11, and I'm using anaconda conda to create the two different environments, that is
conda create --name matplotlib-1.5.1 matplotlib=1.5.1
conda create --name matplotlib-1.4.3 matplotlib=1.4.3
So maybe it is a problem with the anaconda packaging? When I list the packages in those two environments, everything is the same except that matplotlib-1.4.3 has a dependency on py2cairo 1.10.0, whereas matplotlib 1.5.1 has a dependency on py2cairo 1.10.0, and on something new called cycler 0.9.0. I didn't see anything in the http://matplotlib.org/devdocs/users/whats_new.html page that suggested a change here.
pip install pyqtgraph,import pyqtgraph.examples,pyqtgraph.examples.run()). ;-)