Cartopy:使用散点图数据渲染图层的顺序

bub*_*ble 6 python matplotlib cartopy

我试图使用Cartopy在地图上绘制几个点(散点图)的位置(参见下面的代码).当我尝试渲染绘图时,数据点将在LAND层后面呈现.但我想在LAND-layer上绘制我的分散数据......我做错了什么?

Cartopy:ver.0.12.x,Matplotlib:ver.1.4.2

import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature 

ax = plt.axes(projection=ccrs.PlateCarree()) 
ax.set_extent([125, 150, 35, 63])         

ax.stock_img()

ax.add_feature(cfeature.LAND) #If I comment this => all ok, but I need 
ax.add_feature(cfeature.LAKES)
ax.add_feature(cfeature.RIVERS)
ax.coastlines()

ax.scatter(yc,xc,transform=ccrs.PlateCarree()) #yc, xc -- lists or numpy arrays

plt.show()
Run Code Online (Sandbox Code Playgroud)

LAND图层下显示的点

没有LAND层的情节

Pau*_*l H 6

大多数(如果不是全部)matplotlib绘图函数都使用zorder参数来指定绘图顺序.

zorder首先绘制较低的s,因此较高的zorders将出现在"顶部".

所以是的,传递zorder=xxx来安排你的图层.