Using basemap fillcontinents with color causes error

Viewed 79

Packages versions:

basemap : 1.2.2
matplotlib : 3.5.1
GEOS : 3.9.1

With this code I get the following map, in which fillcontinents doesn't cover the Antarctic region :

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

m = Basemap(projection='cyl',llcrnrlat=-90,urcrnrlat=90,\
            llcrnrlon=-180,urcrnrlon=180,resolution='c')
m.drawcoastlines()
m.fillcontinents(color='grey')
plt.show()

my_map

2 Answers

Currently (22 April 2022), basemap works well only with GEOS < 3.9 (see basemap #522). This problem with Antarctica is known to appear with GEOS >= 3.9. Until the bug is solved, a GEOS downgrade should fix your problem with the Antarctica coastline.

Thanks @molinav problem solved by downgrading GEOS from 3.9 to 3.8.1 by

pip install geos==3.8.1

and now the map looks like that : figure_after

Related