there is something i want to do

散布図(分布図)
matplotlibモジュールをインポートして「scatter」を利用することで、数値を散布図(分布図)を表示する。
Syntax
Syntax
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plot
import numpy as npy
# x軸のラベル
plot.xlabel("price")
# y軸のラベル
plot.ylabel("number")
X = [npy.random.rand(100) * 10]
Y = [npy.random.rand(100) * 10]
# 散布図
plot.scatter(X, Y,color="red")
plot.show()
Comment
Comment
import matplotlib でパッケージをインポートする。
matplotlibのパッケージをインポートすることで、scatter()の関数が使用可能になる
Example
#
#cat test.py
#!/usr/bin/python
#-*- coding: utf-8 -*-
import matplotlib.pyplot as plot
import numpy as npy
# x軸のラベル
plot.xlabel("price")
# y軸のラベル
plot.ylabel("number")
X = [npy.random.rand(100) * 10]
Y = [npy.random.rand(100) * 10]
# 散布図
plot.scatter(X, Y,color="red")
plot.show()
#
#python test.py
#

散布図(分布図)