有没有能帮忙解释一下为啥俺的散点图坐标是这个样子啊
代码:
import numpy as np
import math
import matplotlib.pyplot as plt
xlist = []
ylist = []
for sample in open("data.txt", "r"): # 打开文件
sample = sample.split(',')
for item in range(len(sample)//2):
xlist.append(sample[item*2])
ylist.append(sample[item*2+1])
xlist = np.array(xlist)
ylist = np.array(ylist)
print(xlist)
print(ylist)
plt.figure()
plt.scatter(xlist,ylist,c='g',s=6)
plt.show()
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/899959353436159.png "=600 #left")
数据:
0,1835,-1500,1990,-2750,1940,-2750,1870,-1500,2170,0,2153,1500,2135,2750,1900,2750,1830,1500,1955