|
48 | 48 | __all__ = ['GeoAxes', 'BasemapAxes', 'CartopyAxes'] |
49 | 49 |
|
50 | 50 |
|
51 | | -def _circle_boundary(N=100): |
| 51 | +def _circular_boundary(N=100): |
52 | 52 | """ |
53 | 53 | Return a circle `~matplotlib.path.Path` used as the outline for polar |
54 | 54 | stereographic, azimuthal equidistant, Lambert conformal, and gnomonic |
@@ -718,13 +718,18 @@ class CartopyAxes(GeoAxes, GeoAxesBase): |
718 | 718 | ) |
719 | 719 | _proj_polar = _proj_north + _proj_south |
720 | 720 |
|
721 | | - def __init__(self, *args, autoextent=None, map_projection=None, **kwargs): |
| 721 | + def __init__( |
| 722 | + self, *args, autoextent=None, circular=None, map_projection=None, **kwargs |
| 723 | + ): |
722 | 724 | """ |
723 | 725 | Parameters |
724 | 726 | ---------- |
725 | 727 | autoextent : bool, optional |
726 | 728 | Whether to automatically adjust map bounds based on plotted content |
727 | 729 | or enforce *global* map extent. Default is :rc:`cartopy.autoextent`. |
| 730 | + circular : bool, optional |
| 731 | + Whether to bound polar projections with circles rather than squares. |
| 732 | + Default is :rc:`cartopy.circular`. |
728 | 733 | map_projection : `~cartopy.crs.Projection` |
729 | 734 | The `~cartopy.crs.Projection` instance. |
730 | 735 |
|
@@ -770,9 +775,10 @@ def __init__(self, *args, autoextent=None, map_projection=None, **kwargs): |
770 | 775 | # can do their things. This also updates _LatAxis and _LonAxis. |
771 | 776 | # NOTE: Use set_global rather than _update_extent() manually in case projection |
772 | 777 | # extent cannot be global. |
773 | | - if polar and hasattr(self, 'set_boundary'): |
774 | | - self.set_boundary(_circle_boundary(), transform=self.transAxes) |
775 | 778 | auto = _not_none(autoextent, rc['cartopy.autoextent']) |
| 779 | + circular = _not_none(circular, rc['cartopy.circular']) |
| 780 | + if polar and circular and hasattr(self, 'set_boundary'): |
| 781 | + self.set_boundary(_circular_boundary(), transform=self.transAxes) |
776 | 782 | if auto: |
777 | 783 | self._set_view_intervals(self._get_global_extent()) |
778 | 784 | elif polar: |
|
0 commit comments