| 
 
	积分4051贡献 精华在线时间 小时注册时间2019-3-6最后登录1970-1-1 
 | 
 
 发表于 2021-3-15 20:45:49
|
显示全部楼层 
| 画的40N以上的站点图,文件为csv格式。仅供参考 
 
 复制代码import pandas as pd
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import cartopy.mpl.ticker as cticker
import cartopy.io.shapereader as shpreader
import numpy as np
data = pd.read_csv("G:/GHCND/ghcnd_all/ghcnd-stations-60E-170W_40-90.csv",sep=',', \
                        header=None, names=['station','lat','lon','altitude','country','number'])  
#建立画布
fig2 = plt.figure(figsize=(10,8))
proj = ccrs.PlateCarree(central_longitude=110) 
leftlon, rightlon, lowerlat, upperlat = (60,190,0,90)
#绘制地图
f2_ax1 = fig2.add_subplot(1,1,1,projection = proj) 
#在画布的绝对坐标建立子图
f2_ax1.set_extent([leftlon, rightlon, lowerlat, upperlat], crs=ccrs.PlateCarree())
#海岸线,50m精度
f2_ax1.add_feature(cfeature.COASTLINE.with_scale('50m'))
#以下6条语句是定义地理坐标标签格式
f2_ax1.set_xticks(np.arange(leftlon,rightlon,20), crs=ccrs.PlateCarree())
f2_ax1.set_yticks(np.arange(lowerlat,upperlat,20), crs=ccrs.PlateCarree())
lon_formatter = cticker.LongitudeFormatter()
lat_formatter = cticker.LatitudeFormatter()
f2_ax1.xaxis.set_major_formatter(lon_formatter)
f2_ax1.yaxis.set_major_formatter(lat_formatter)
f2_ax1.set_title('Station',loc='center',fontsize =15)
s = f2_ax1.scatter(data.lon,data.lat,s = 5,c='k',transform=ccrs.PlateCarree())
#fig2.savefig('./pic/station40.jpg')
plt.show()
 | 
 |