If you get an error about matplotlib being broken, you need to upgrade or downgrade the package.
Ubuntu
Since Ubuntu 9.10 (karmic) a correct package is normally available, its version is 0.99.0-1ubuntu1.
If you don't want to upgrade, try python-matplotlib 0.98.1, for example from Debian packages (version 0.98.1-1+lenny4).
After installing the updated package with dependencies, if you see 'generating graphs' message and progress bar reaching end without anything showing, you should remove your config.db. To make a backup run mv ~/.anki/config.db ~/config.db.old.
