import matplotlib.pyplot as plt
import numpy as np
import csv
plt.rcParams['font.sans-serif']=['SimHei']#显示中文
plt.rcParams['axes.unicode_minus']=False#显示正负号
x=[]
y=[]
with open('data.csv') as csvfile:
plots=csv.reader(csvfile,delimiter=',')
for row in plots:
x.append(row[0])
y.append(row[1])
plt.scatter(x,y)
plt.show()
转载于:https://www.cnblogs.com/shunguo/p/11399365.html