Python入门第五课:Numpy计算和Matplotlib绘图

绘制散点图
# coding:utf-8
import numpy as np
import matplotlib.pyplot as pit

d = np.loadtxt("d:\\height.csv", delimiter=",")
# print(d[:,0])
# print(d[:,1])

pit.figure(figsize=(8, 4), dpi=100)  # 默认英寸

lines = pit.scatter(d[:,0], d[:,1])
pit.setp(lines, color="red", linewidth=4.0)
pit.show()

发表评论

邮箱地址不会被公开。 必填项已用*标注