import pandas as pd from math import radians,ceil, cos, sin, asin, sqrt import matplotlib.pyplot as plt import numpy as np df=pd.read_excel('E:\数据\实验.xlsx') X=[] Y=[] for i in range(0,len(df.num)): df1=df[df['num']==i+1] x=df1.lon y=df1.lat X.append(x) Y.append(y) plt.scatter(X,Y) i=2 while i<=1202: df1 = df[df['num'] == i] plt.axvline(x=df1.lon, color='b', linestyle='--') plt.axhline(y=df1.lat, color='r', linestyle='--') i=i+30 plt.show()
我只想取等差为30的点,就报错,萌新提问