ひよこメモ

備忘ブログ Ruby, Rails, AWS, html5, css3, javascript, vim,

matplotlib.pyplotを知る

matplotlib.pyplot:
python機械学習等の図形描写用ライブラリ

matplotlib.pyplot.scatter()
scatterは「散乱」。散布図の描画。

import numpy as np
import matplotlib.pyplot as plt

# 50個の0~1のランダムな数値を取得
x = np.random.rand(50)
y = np.random.rand(50)
 
# 散布図を描画
plt.scatter(x, y)

f:id:hiyotama:20210303143952p:plain