Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly document behavior of set_extent #1729

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions lib/cartopy/mpl/geoaxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,19 @@ def set_extent(self, extents, crs=None):
Set the extent (x0, x1, y0, y1) of the map in the given
coordinate system.

If no crs is given, the extents' coordinate system will be assumed
to be the Geodetic version of this axes' projection.
set_extent has a complex behavior.

1) if no CRS is given, the map projection is Plate Carree, and the
extent given is [-180, 180, -90, 90], the globe will be plotted.
2) if no CRS is given, the extent must be in longitudes and latitudes.
A Geodetic CRS with Globe parameters inherited from the map projection
will be used to transform the extent into map projection units. The
bounds of the transformed geometry will be set as the extents of the
map. Thus no CRS with a Plate Carree projection and extent = [-179,
179, -89, 89] will plot [-180, 180, -89, 89].
3) if a CRS is given it will be used to transform the extent into map
projection units. The bounds of the transformed geometry will be set
as the extent of the map.

Parameters
----------
Expand Down