底图无法找到沿轴警告的像素距离
Basemap Unable to find pixel distance along axis warning
以下代码片段产生警告。 csv 包含经度和纬度列表。 csv 包含大约 800,000 个示例,
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
fname = "train.csv"
data = pd.read_csv(fname,sep=",",quotechar='"')
minlon=data["X"].min()
maxlon=data["X"].max()
minlat = data["Y"].min()
maxlat = data["Y"].max()
m =Basemap(projection='merc',llcrnrlat=minlat,urcrnrlat=maxlat,llcrnrlon=-minlon,urcrnrlon=maxlon,resolution='c')
m.drawcoastlines()
m.drawmapboundary()
x,y = m(list(data["X"].astype(float)),list(data["Y"].astype(float)))
m.scatter(x,y,1,marker='o',color='red')
plt.show()
地图的显示方式如下:
生成的警告内容如下:
UserWarning: Unable to find pixel distance along axis for interval padding of ticks; assuming no interval padding needed. warnings.warn("Unable to find pixel distance along axis "
根据定义,墨卡托投影不适用于两极,是否存在某些纬度值 -90 度或 90 度?
以下代码片段产生警告。 csv 包含经度和纬度列表。 csv 包含大约 800,000 个示例,
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
fname = "train.csv"
data = pd.read_csv(fname,sep=",",quotechar='"')
minlon=data["X"].min()
maxlon=data["X"].max()
minlat = data["Y"].min()
maxlat = data["Y"].max()
m =Basemap(projection='merc',llcrnrlat=minlat,urcrnrlat=maxlat,llcrnrlon=-minlon,urcrnrlon=maxlon,resolution='c')
m.drawcoastlines()
m.drawmapboundary()
x,y = m(list(data["X"].astype(float)),list(data["Y"].astype(float)))
m.scatter(x,y,1,marker='o',color='red')
plt.show()
地图的显示方式如下:
生成的警告内容如下:
UserWarning: Unable to find pixel distance along axis for interval padding of ticks; assuming no interval padding needed. warnings.warn("Unable to find pixel distance along axis "
根据定义,墨卡托投影不适用于两极,是否存在某些纬度值 -90 度或 90 度?