2222
2323import cartopy .crs as ccrs
2424import cartopy .io .shapereader as shpreader
25+ from matplotlib .patches import Rectangle
2526
2627
2728# Define choices for projection and locations to plot
3738
3839
3940def main ():
40- # Set up a plot with a thin light blue/white border to make the map inside
41- # Note: for proportions of land mass, font size and border to be as
42- # intended, need to keep 'figsize' and 'dpi' (4:3 ratio) as below.
43- fig = plt .figure (figsize = (9 , 7.5 ), dpi = 125 , facecolor = "#AFCBBD" )
41+ # Set up a plot with a light blue background and a white overall border.
42+ # For proportions of land mass, font size and border to be as
43+ # intended, need to keep 'figsize' and 'dpi' (4:3 ratio) as below.
44+ fig = plt .figure (
45+ figsize = (9 , 7.5 ),
46+ dpi = 125 ,
47+ facecolor = "#AFCBBD" ,
48+ edgecolor = "white" , # sets up white border without need for another axes
49+ linewidth = 30 , # makes the border thicker as per original map
50+ )
4451 map_ax = fig .add_axes (
4552 [0.035 , 0.035 , 0.93 , 0.93 ], projection = ccrs .LambertConformal (), frameon = False
4653 )
@@ -66,10 +73,8 @@ def main():
6673 edgecolor = "black" ,
6774 )
6875
69- # From/see example:
70- # https://scitools.org.uk/cartopy/docs/latest/gallery/
71- # scalar_data/eyja_volcano.html
72- # Now add the location labels
76+ # Now add the location labels. The general approach is that covered in
77+ # the 'Map tile acquisition' Catopy example, including the comment below.
7378 #
7479 # Use the cartopy interface to create a matplotlib transform object
7580 # for the Geodetic coordinate system. We will use this along with
@@ -111,10 +116,10 @@ def main():
111116 "(recreation of map at\n simpsons.fandom.com/\n wiki/Brockway)"
112117 )
113118
114- # Add the 'compass' legend
119+ # Add the bottom left 'compass' legend in spirit of the original map.
115120 map_ax .text (
116121 0.14 ,
117- 0.10 ,
122+ 0.0 ,
118123 leg_text ,
119124 transform = map_ax .transAxes ,
120125 fontsize = 11 ,
0 commit comments