Python - Matplotlib - Can't plot - Tkinter crashes

I have cross posted this at

I installed python 2.7.2 from ActiveState and then installed matplotlib from the sources. I getting errors when I tried a simple plotting procedure to test it.

The error is similar to the one described here ( but it is for Macintosh. I work on a Linux machine and the info about machine is given below:

% cat /etc/redhat-release

CentOS release 4.6 (Final)

% uname -a

scdbuild04 2.6.9-67.ELsmp #1 SMP Fri Nov 16 12:49:06 EST 2007 x86_64 x86_64 x86_64 GNU/Linux

The error is produced by:

% python

ActivePython (ActiveState Software Inc.) based on

Python 2.7.2 (default, Jun 24 2011, 11:24:26)

[GCC 4.0.2 20051125 (Red Hat 4.0.2-8)] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

import matplotlib.pylab as plt


x = [1,2,3]


Exception in Tkinter callback

Traceback (most recent call last):

File “/a/b/python2.7.2/linux26_x86_64/lib/python2.7/lib-tk/”, line
1410, in call

return self.func(*args)

File “/a/b/python2.7.2/linux26_x86_64/lib/python2.7/site-packages/matplotlib/backends/”, line 236, in resize

File “/a/b/python2.7.2/linux26_x86_64/lib/python2.7/site-packages/matplotlib/backends/”, line 240, in draw

tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)

File “/a/b/python2.7.2/linux26_x86_64/lib/python2.7/site-packages/matplotlib/backends/”, line 19, in blit“PyAggImagePhoto”, photoimage, id(aggimage), colormode, id(bbox_array))


[<matplotlib.lines.Line2D object at 0x2a9da13310>]

Can some
one help me fix this error?