本文整理汇总了Python中mpl_toolkits.basemap.Basemap.axis方法的典型用法代码示例。如果您正苦于以下问题:Python Basemap.axis方法的具体用法?Python Basemap.axis怎么用?Python Basemap.axis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpl_toolkits.basemap.Basemap
的用法示例。
在下文中一共展示了Basemap.axis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot_stations
# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import axis [as 别名]
def plot_stations(self, gsac):
figStation = plt.figure('SeismoStations', figsize=(16, 12))
figStation.suptitle('Seismic Stations', fontsize=20)
# lower-left/upper-right corners for the cascades domain.
minLat, minLon, maxLat, maxLon = self.bounding_rectangle()
# Central lat/lon coordinates.
centerLat = 0.5 * (minLat + maxLat)
centerLon = 0.5 * (minLon + maxLon)
qLat = min(abs(minLat),abs(maxLat))
h = 1.2*6370997.*np.radians(maxLat-minLat)
w = 1.1*6370997.*np.radians(maxLon-minLon)*np.cos(np.radians(qLat))
#make the basemap
if basemapthere:
#ax = Basemap(llcrnrlon=minLon, llcrnrlat=minLat,
# urcrnrlon=maxLon, urcrnrlat= maxLat,
ax = Basemap(width=w,
height=h,
resolution='i',
area_thresh=1000.,
projection='lcc',
lat_0=centerLat,
lon_0=centerLon)
ax.drawstates()
ax.drawcountries()
ax.drawcoastlines()
plt.xlabel('Black triangles: deleted stations\n Red Points: selected stations')
else:
simplexmin = minLon-1.
simplexmax = maxLon+1.
simpleymin = minLat-1.
simpleymax = maxLat+1.
ax = figStation.add_subplot(111)
ax.axis([simplexmin, simplexmax, simpleymin, simpleymax])
plt.xlabel('Black triangles: deleted stations\n Red Points: selected stations\n No coastline because Basemap module not found')
plt.title(self.plotname)
# plot stations
if hasattr(gsac, 'delay_times'):
self.plot_selected_stations_color_delay_times(ax, gsac.delay_times)
else:
self.plot_selected_stations(ax)
self.plot_deleted_stations(ax)
figStation.canvas.mpl_connect('pick_event', self.show_station_name)
self.figStation = figStation
self.ax = ax
plt.show()