basemap icon indicating copy to clipboard operation
basemap copied to clipboard

fillcontinents and aeqd projection

Open MMesch opened this issue 7 years ago • 2 comments

The fillcontinents routine seems to fill the ouside of the continents, not the inside under some specific lat/lon values. (basemap.__version__ = 1.1.0 from conda-forge)

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

clon, clat = 62.426312397000004, -34.6302096207
bmap = Basemap(projection='aeqd', lat_0=clat, lon_0=clon)

fig, ax = plt.subplots()

conts = bmap.fillcontinents(zorder=9)
conts = bmap.drawcoastlines(color='black', zorder=10)

plt.show()

figure_1

MMesch avatar Nov 13 '17 11:11 MMesch

This script shows some more details of the issue:

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

clons, clats = [30, 45, 60, 75, 90], [-40, -40, -40, -40, -40]

fig, axes = plt.subplots(1, len(clons))

for ax, clon, clat in zip(axes, clons, clats):
    plt.sca(ax)
    bmap = Basemap(projection='aeqd', lat_0=clat, lon_0=clon)

    conts = bmap.fillcontinents(zorder=9)
    conts = bmap.drawcoastlines(color='black', zorder=10)
    ax.set_title('{}/{}'.format(clon, clat))

plt.show()

figure_1

MMesch avatar Nov 13 '17 11:11 MMesch

workaround is using bmap.drawlsmask

MMesch avatar Nov 13 '17 12:11 MMesch