仅在马普托利布大陆上绘制 [英] Plot only on continent in matplotlib
问题描述
matplotlib.basemap中有方法: is_land(xpt,ypt)
它返回如果给定的x,y点(投影坐标)在土地上,
False
否则为true。土地的定义是基于与阶级实例相关的GSHHS海岸线多边形。在地区内的湖泊点不算作陆地点。
有关更多信息,请参阅这里。
I am drawing a map using basemap from matplotlib. The data are spreaded all over the world, but I just want to retain all the data on the continent and drop those on the ocean. Is there a way that I can filter the data, or is there a way to draw the ocean again to cover the data?
There's method in matplotlib.basemap: is_land(xpt, ypt)
It returns True
if the given x,y point (in projection coordinates) is over land, False
otherwise. The definition of land is based upon the GSHHS coastline polygons associated with the class instance. Points over lakes inside land regions are not counted as land points.
For more information, see here.
这篇关于仅在马普托利布大陆上绘制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!