@@ -1484,6 +1484,17 @@ def Scale(scale, *args, **kwargs):
14841484 return scale (* args , ** kwargs )
14851485
14861486
1487+ def _warn_basemap_deprecated ():
1488+ """
1489+ Warn that the basemap backend is deprecated.
1490+ """
1491+ warnings ._warn_ultraplot (
1492+ "The basemap backend was deprecated in version 3.0.0 and may be removed "
1493+ "in a future release. Please use the cartopy backend instead. "
1494+ "See https://github.com/Ultraplot/ultraplot/pull/243"
1495+ )
1496+
1497+
14871498def Proj (
14881499 name ,
14891500 backend = None ,
@@ -1574,6 +1585,10 @@ def Proj(
15741585 backend : {'cartopy', 'basemap'}, default: :rc:`geo.backend`
15751586 Whether to return a cartopy `~cartopy.crs.Projection` instance
15761587 or a basemap `~mpl_toolkits.basemap.Basemap` instance.
1588+
1589+ .. deprecated:: 3.0.0
1590+ The ``'basemap'`` backend is deprecated and may be removed in a
1591+ future release. Please use the ``'cartopy'`` backend instead.
15771592 lon0, lat0 : float, optional
15781593 The central projection longitude and latitude. These are translated to
15791594 `central_longitude`, `central_latitude` for cartopy projections.
@@ -1670,6 +1685,8 @@ def Proj(
16701685 f"Unexpected projection { name !r} . Must be PROJ string name, "
16711686 "cartopy.crs.Projection, or mpl_toolkits.basemap.Basemap."
16721687 )
1688+ if backend == "basemap" :
1689+ _warn_basemap_deprecated ()
16731690 for key_proj , key_cartopy , value in (
16741691 ("lon_0" , "central_longitude" , lon0 ),
16751692 ("lat_0" , "central_latitude" , lat0 ),
@@ -1692,6 +1709,8 @@ def Proj(
16921709 warnings ._warn_ultraplot (f"Ignoring Proj() keyword arg(s): { kwargs !r} ." )
16931710 proj = name
16941711 backend = "cartopy" if is_crs else "basemap"
1712+ if is_basemap :
1713+ _warn_basemap_deprecated ()
16951714
16961715 # Cartopy name
16971716 # NOTE: Error message matches basemap invalid projection message
0 commit comments