Skip to content

Commit 31440f0

Browse files
committed
Issue #610 changed the central longitude of projection to 0
1 parent d233a76 commit 31440f0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

examples/shade.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from mpl_toolkits.basemap import Basemap
2+
import numpy as np
3+
import matplotlib.pyplot as plt
4+
from datetime import datetime
5+
6+
7+
# lon_0 is central longitude of projection.
8+
# resolution = 'c' means use crude resolution coastlines.
9+
m = Basemap(projection='robin',lon_0=180,resolution='c')
10+
11+
m.drawcoastlines()
12+
m.fillcontinents(color='coral',lake_color='aqua')
13+
14+
# draw parallels and meridians.
15+
m.drawparallels(np.arange(-90.,120.,30.))
16+
m.drawmeridians(np.arange(0.,360.,60.))
17+
m.drawmapboundary(fill_color='aqua')
18+
19+
date = datetime(2024,10,10,6)
20+
21+
m.nightshade(date,alpha=0.2)
22+
23+
plt.title("Robinson Projection")
24+
plt.savefig('test.png')
25+

0 commit comments

Comments
 (0)