matplotlibにてrasterized=Trueとすると, 背景が真っ黒になる

matplotlibにてrasterized=Trueとすると, 背景が真っ黒になる.
環境はubuntu14.04.
(12.04の時は特に問題なかったのに...)


以下の画像は, 1枚目がpngファイルで出力, 2枚目がepsファイルで出力した時の結果.
(ただし, epsファイルをアップロード出来なかったので, pngに変換している)

ググってみると, matplotlibのバージョンを更新すれば解決できるみたい.

$sudo pip install --upgrade matplotlib

http://stackoverflow.com/questions/25511550/python-matplotlib-remove-black-background-when-rasterizing-part-of-plot-in-eps

しかし, 次のようなエラーがでた:

===========================================================================
* The following required packages can not be built:

* freetype

                                                                              • -

Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/ryoji/.pip/pip.log

freetypeがないらしいので, インストール:

$sudo apt-get install libfreetype6-dev

http://stackoverflow.com/questions/20533426/ubuntu-running-pip-install-gives-error-the-following-required-packages-can-no

再度更新すると, うまくインストールできた & rasterizedの問題が修正された.

$sudo pip install --upgrade matplotlib