python 利用matplolib给绘制的地图添加方框,将所需的区域圈出来
在气象绘图时,有时候需要用方框将重点位置凸显出来,下面是我的方法,此贴自己备忘用。
#添加黄渤海范围的红框
left_x = 117
bottom_left_y = 30
width = 10
height = 12
rect = plt.Rectangle((left_x, bottom_left_y), width, height, linestyle = '--',
fill=False, edgecolor = 'red', linewidth = 1, zorder = 5)
ax.add_patch(rect)
这样画的图就会有方框了