This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
python:matplotlib:基本的な使い方 [2018/01/20 21:42] koudai |
python:matplotlib:基本的な使い方 [2018/01/20 21:49] koudai |
||
---|---|---|---|
Line 3: | Line 3: | ||
matplotlibの必要最低限の使い方を解説します。 | matplotlibの必要最低限の使い方を解説します。 | ||
- | {{:python:matplotlib:plot.png?400|}} | + | |
+ | ====== 関数のプロット ====== | ||
+ | |||
+ | 三角関数を例に、関数のプロット方法と簡単な調節の仕方を紹介します。 | ||
+ | |||
+ | ===== sin関数のプロット ===== | ||
+ | |||
+ | < | ||
+ | import numpy as np | ||
+ | import | ||
+ | |||
+ | x = np.arange(-np.pi, | ||
+ | y = np.sin(x) | ||
+ | |||
+ | plt.plot(x, y) | ||
+ | plt.show() | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== データのプロット ====== | ||
+ | |||
+ | |||
+ |