LoginSignup
6
6

More than 5 years have passed since last update.

matplotlibのインストール(Python 3.3.2)

Last updated at Posted at 2013-10-11

(追記 2013/10/21)
・SciPyのインストールを追記

インストール

scipyインストールにFORTRANのコンパイラが必要らしい。

% brew install gfortran

次に、pipでいろいろインストール。

% pip install ipython

% pip install readline

% pip install numpy

% CC=clang CXX=clang FFLAGS=-ff2c pip install scipy

% pip install matplotlib

※ scipyのインストールはここを参考に

ipython

IPython (あいぱいそん) はPythonを対話的に実行するためのシェルである。オリジナルの Python に比較して、型推定を強化し、対話的実行のための文法を追加してあり、コード・ハイライティングおよびタブによる補完が行える。IPython は SciPy パッケージの一部として公開されている。
引用元:Wikipedia (IPython)

readline
文字列入力用ライブラリ。ipythonを使いやすくする。

numpy

Python用の拡張モジュールであり、数値計算を効率的に行うための型付きの多次元配列(例えばベクトルや行列などを表現できる)のサポートをPythonに加えるとともに、それらを操作するための大規模な高水準の数学関数ライブラリを提供する。
引用元:Wikipedia (NumPy)

scipy

NumPyの配列・行列演算に加えて、高次元の科学技術計算を可能にするライブラリ。
引用元:パーフェクトPython 株式会社技術評論社 P. 291

matplotlib

Pythonおよびその科学計算用ライブラリNumPyのためのグラフ描画ライブラリである。
引用元:Wikipedia (matplotlib)

シンボリックリンクを張る

virtualenvを使っている場合、.virtualenvs/仮想環境名/bin/にipython3がインストールされるので、シンボリックリンクを張っとく。

% cd ~/.virtualenvs/仮想環境名/bin
% ln -s ipython3 ./ipython

これで、ターミナルからipythonでipythonが起動できる。

グラフを描いてみる

# ipythonを起動
% ipython --pylab
In [1]: x = arange(0,1,0.1)

In [2]: y = 2*x

In [3]: plot(x,y)
Out[3]: [<matplotlib.lines.Line2D at 0x10cbbec10>]

figure_1.png

参照

sessanの日記 - OS X Mountain Lion 環境にmatplotlibをインストールする
@IT - ITエンジニアのためのデータサイエンティスト養成講座(3)
akiyoko blog
F13 - PyBrainでニューラルネットワーク - インストール編

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6