我想绘制一个类似于以下示例的形状(来自海军研究实验室TC页面)。形状由4个半径定义,每个象限一个。
我在纬度和经度坐标中有多个跟踪中心,我使用底图进行了绘制:
def m_plot_wind_speeds(x,y,mps):
# There's a switch-like statement here to determine the color of the
# line based on wind speed which I ignored. This is passed to the
# color kwarg in m.plot as cur_color.
m.plot(x,'.-',markersize=ms,linewidth=lw,color=cur_color,\
mew=1.5,markerfacecolor='k')
m = Basemap(projection='cyl',area_thresh=1000,\
llcrnrlat=southLat,urcrnrlat=northLat,llcrnrlon=westLong,urcrnrlon=eastLong,resolution='h')
parallels = np.arange(southLat,northLat+10,10.) # make latitude lines ever 5 degrees from 30N-50N
meridians = np.arange(westLong,eastLong+30,30.) # make longitude lines every 5 degrees from 95W to 70W
m.drawparallels(parallels,labels=[1,0],labelstyle="+/-",linewidth=0,fontsize=6)
m.drawmeridians(meridians,labels=[0,1],fontsize=6)
m.drawcountries(linewidth=0.25)
m.bluemarble()
# data is a [10]x[~]x[10] list. There are 10 trajectories,each with
# varying lengths. Each trajectory has 10 attributes.
for traj in data:
lat = []
lon = []
wind_speed=[]
for i in traj:
lat.append(float(i[1]))
lon.append(float(i[0]))
wind_speed.append(float(i[2]))
for j,var in enumerate(traj):
if j > 0:
x,y = m([lon[j],lon[j-1]],[lat[j],lat[j-1]])
else:
x,lon[j]],lat[j]])
m_plot_wind_speeds(x,wind_speed[j])
# TODO: Insert a function here that takes in a 4 radii and plots them
# in each quadrant.