エラー内容

いざmatplotを利用して描画しようとすると、下記のようなエラーが出てしまった。 Pythonをフレームワーク形式でインストールしていないので、backendとして利用している Cocoa API が利用できない感じだろう。

RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. 
See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends.
If you are Working with Matplotlib in a virtual enviroment see 'Working with Matplotlib in Virtual environments' in the Matplotlib FAQ

解決策

設定ファイルを編集して使用する backend を変更する。

設定ファイルの場所は以下のコマンドを実行することでわかる。

$ python -c "import matplotlib;print(matplotlib.matplotlib_fname())"

上記でわかった .matplotlibrc のファイルの backend を以下で書き換える。

backend : Tkagg