views:

323

answers:

2

In the computers of our laboratory, which have Python 2.6.2 installed in them, my program, which is an animation of the 2D random walk and diffusion, works perfectly.

However, I can't get the exact same program to work on my laptop, which has Python 2.5. By that not working, I mean the animation is screwed; the axis always changes every time the pylab.draw() and pylab.clf() commands are called in a for loop.

I call a pylab.axis([specified axis]) command before and after draw() and clf() to fix the "field-of-view", but it's still the same - what I get is a flickering series of image instead of the smooth animation I get when I run the exact same program in our laboratory.

I tried to install Python 2.6 in my laptop, but I discovered that there is no Numpy for Py2.6. So it is a mystery to me that my program, which imports Numpy and uses many of its functions, works in our laboratory computer. What can be done with my compatibility problem?

A: 

Numpy for python 2.6 appears to be downloadable from numpy sourceforge or can be compiled from source

Mark
+1  A: 

The various (matplotlib.pyplot) graphical backends do not behave in exactly the same way.

You could try setting the backend so that it is the same on both machines:

matplotlib.use('GTKagg')  # Right after importing matplotlib

For a list of possible backends, you can do matplotlib.use('...').

EOL