@@ -577,15 +577,21 @@ def plot_basemap(basemap, extent, ax=None, coastline=True, borders=False, linec
577
577
578
578
"""
579
579
if ax is None :
580
- fig = pyplot .figure ()
581
- ax = fig .add_subplot (111 , projection = projection )
582
580
if apprx :
581
+ projection = ccrs .PlateCarree ()
582
+ fig = pyplot .figure ()
583
+ ax = fig .add_subplot (111 , projection = projection )
583
584
# Re-aspect plot (only for plain matplotlib plots, or when using PlateCarree)
584
585
LATKM = 110.574
585
- ax .set_aspect (1 / (LATKM / 111.320 * numpy .cos (numpy .deg2rad (central_latitude ))))
586
+ ax .set_aspect (111.320 * numpy .cos (numpy .deg2rad (central_latitude )) / LATKM )
587
+ else :
588
+ fig = pyplot .figure ()
589
+ ax = fig .add_subplot (111 , projection = projection )
586
590
587
591
if set_global :
588
592
ax .set_global ()
593
+ else :
594
+ ax .set_extent (extents = extent , crs = ccrs .PlateCarree ())
589
595
590
596
try :
591
597
# Set adaptive scaling
@@ -697,7 +703,7 @@ def plot_catalog(catalog, ax=None, show=False, extent=None, set_global=False, pl
697
703
pass
698
704
699
705
if extent is None :
700
- dh = (bbox [1 ] - bbox [0 ])/ 20.
706
+ dh = (bbox [1 ] - bbox [0 ]) / 20.
701
707
dv = (bbox [3 ] - bbox [2 ]) / 20.
702
708
extent = [bbox [0 ] - dh , bbox [1 ]+ dh , bbox [2 ] - dv , bbox [3 ] + dv ]
703
709
@@ -713,8 +719,6 @@ def plot_catalog(catalog, ax=None, show=False, extent=None, set_global=False, pl
713
719
if ax is None :
714
720
fig = pyplot .figure (figsize = figsize )
715
721
ax = fig .add_subplot (111 , projection = projection )
716
- else :
717
- fig = ax .get_figure ()
718
722
719
723
if set_global :
720
724
ax .set_global ()
0 commit comments