To install the Python library matplotlib on a stock CentOS 5 system, you will need to resolve a freetype dependency issue prior to install. matplotlib 1.4.3 requires freetype ver >=2.3. CentOS 5's repositories top out at freetype 2.2.1.
To meet this dependency, download, compile and install a more recent version of freetype from here (this has been verified to work on a CentOS 5 system with freetype 2.4.0)
After downloading, do the usual unpack, configure, and make. Note that the default configuration will place the new freetype under /usr/local; for reference, the base CentOS install is under /usr.
Substitute the appropriate version of freetype below if not using 2.4.0