From: Benjamin R. <ben...@ou...> - 2011-08-11 16:30:25
|
On Thu, Aug 11, 2011 at 10:46 AM, Ned <a.g...@du...> wrote: > Hi, > I'm trying to sort out interactive use with standard python but am having > problems. > If I do: > import matplotlib > matplotlib.use("TkAgg") > matplotlib.interactive(True) > import pylab > pylab.ion() > pylab.plot([1,2,3,4]) > > Then I would expect a plot to appear. But it doesn't. I then have to > call: > > pylab.draw() > > twice before getting the plot (the first call brings up an empty plot > window, while the second displays the plot). > > Then, if I do: > pylab.plot([1,2,3,2,3,4,5]) > again, it does nothing, until I do > pylab.draw() > > Also the window isn't sensitive to expose events - if it is blocked by > another window/minimised etc, then the contents don't reappear, just go > blank. > > So, it is semi-interactive, in that I can use the python command line to > add new lines, but I have to call draw each time (which I shouldn't have > to), and also it doesn't redraw itself correctly. > > Can anyone give ideas? > > The problem is mostly with the version of matplotlib you have. Significant effort went into interactivity for v1.0.x, and I believe your problem would be greatly eliminated by using v1.0.1. You are right, you shouldn't have to call draw() all the time. > I'm running on ubuntu 10.04 32bit, with distro package 0.99 for > matplotlib. I haven't been able to find anything that helps online > either. > > I don't remember who was hosting it, but I recall someone had a matplotlib v1.0.1 PPA. I also believe that we got everything fixed for release to Debian (and thus Ubuntu) for the upcoming Ubuntu. Anybody know where that PPA is? Ben Root |