1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
matplotlib.rcParams['font.sans-serif'] = ['SimHei']
mp = Basemap(width = 4500000, height = 4000000, projection = 'aea', resolution = 'l', lon_0 = 125, lat_0 = 25)
mp.drawcoastlines()
mp.drawcountries()
mp.drawmapboundary(fill_color = 'aqua')
mp.fillcontinents(color = 'pink', lake_color = 'b')
mp.drawmeridians(np.arange(-180., 181., 20.), labels = [0, 0, 0, 1], fontsize = 12)
mp.drawparallels([12, 26.5, 35], labels = [1, 0, 0, 0], fontsize = 12, linewidth = 2, color='red', dashes=[2, 2])
ax = plt.gca()
plt.annotate(u"渤海", xy = (0.38, 0.86), xycoords = 'axes fraction', color = 'r', fontsize = 12)
plt.annotate(u"黄海", xy = (0.42, 0.72), xycoords = 'axes fraction', color = 'r', fontsize = 12)
plt.annotate(u"东海", xy = (0.46, 0.60), xycoords = 'axes fraction', color = 'r', fontsize = 12)
plt.annotate(u"南海", xy = (0.20, 0.18), xycoords = 'axes fraction', color = 'r', fontsize = 12)
box = dict(fc = 'w', ec = 'k', alpha = 0.9)
plt.annotate(u"5月1日12时至9月1日12时", xy = (0.38, 0.81), xycoords = 'axes fraction', fontsize = 12, bbox = box)
plt.annotate(u"5月1日12时至9月16日12时", xy = (0.46, 0.66), xycoords = 'axes fraction', fontsize = 12, bbox = box)
plt.annotate(u"5月1日12时至8月16日12时", xy = (0.20, 0.27), xycoords = 'axes fraction', fontsize = 12, bbox = box)
plt.show()
|