1
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

matplotlib

Last updated at Posted at 2018-03-28

#matplotlibとは
pythonでグラフを書くときに使うライブラリである。

##使い方
1.まずインポート
import matplotlib.pyplot as plt

2.plot関数にデータを渡す。
plt.plot(x, y)
xに入るのがx軸のデータ
yに入るのがy軸のデータ

3.グラフを出す
plt.show()

##実践
折れ線グラフ
右肩上がりになるように折れ線グラフを表示してみましょう。
x = [1,2,3,4,5]

plt.plot(x, y)
plt.show()```
![無題.png](https://qiita-image-store.s3.amazonaws.com/0/239684/0a98ca37-2e53-8748-0c7c-2ae6736d0cb9.png)

***分布図***
先ほどの```plt.plot(x, y)```を```plt.plot(x, y,"o")```に変える。
![無題.png](https://qiita-image-store.s3.amazonaws.com/0/239684/bd8015ba-d06d-0463-c72c-b9c42acbc1d6.png)

1
7
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
1
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?