删除matplotlib底图周围的矩形边框

时间:2019-12-10 02:15:25

标签: python matplotlib matplotlib-basemap

有没有办法在底图周围没有边框的情况下绘制底图地图?我正在使用此代码:

    fig, ax = plt.subplots(figsize=(15, 10))
    ax = plt.axes(projection=ccrs.PlateCarree())
    ax.add_geometries(poly, crs=ccrs.PlateCarree(), facecolor='none', edgecolor='0.75', linewidth=2.)

    map = Basemap(llcrnrlon=llcrnrlon, llcrnrlat=llcrnrlat, urcrnrlon=urcrnrlon, urcrnrlat=urcrnrlat,
                  resolution='h', projection='cyl')

    # draw parallels.
    parallels = np.arange(-90., 90, 5.)
    map.drawparallels(parallels, labels=[1, 0, 0, 0], fontsize=12)
    # draw meridians
    meridians = np.arange(-180., 180., 5.)
    map.drawmeridians(meridians, labels=[0, 0, 0, 1], fontsize=12)

,地图看起来像这样(我想保留国家/地区边界,但不保留黑色矩形边界):

enter image description here

0 个答案:

没有答案