Skip to content

Commit 89a1afe

Browse files
authored
Update geo doc (#129)
* update intersphinx links
1 parent cf9a598 commit 89a1afe

File tree

1 file changed

+49
-52
lines changed

1 file changed

+49
-52
lines changed

docs/projections.py

+49-52
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@
3838
# ----------
3939
#
4040
# To create `polar axes <polar_>`_, pass ``proj='polar'`` to an axes-creation
41-
# command like `ultraplot.figure.Figure.add_subplot`. Polar axes are represented with the
41+
# command like :meth:`ultraplot.figure.Figure.add_subplot`. Polar axes are represented with the
4242
# :class:`~ultraplot.axes.PolarAxes` subclass, which has its own :func:`~ultraplot.axes.PolarAxes.format`
43-
# command. `ultraplot.axes.PolarAxes.format` facilitates polar-specific modifications
43+
# command. :meth:`ultraplot.axes.PolarAxes.format` facilitates polar-specific modifications
4444
# like changing the central radius `r0`, the zero azimuth location `theta0`,
4545
# and the positive azimuthal direction `thetadir`. It also supports toggling and
4646
# configuring the "major" and "minor" gridline locations with `grid`, `rlocator`,
4747
# `thetalocator`, `gridminor`, `rminorlocator`, and `thetaminorlocator` and formatting
4848
# the gridline labels with `rformatter` and `thetaformatter` (analogous to `xlocator`,
4949
# `xformatter`, and `xminorlocator` used by :func:`ultraplot.axes.CartesianAxes.format`),
5050
# and creating "annular" or "sector" plots by changing the radial or azimuthal
51-
# bounds `rlim` and `thetalim`. Finally, since `ultraplot.axes.PolarAxes.format`
52-
# calls `ultraplot.axes.Axes.format`, it can be used to add axes titles, a-b-c
51+
# bounds `rlim` and `thetalim`. Finally, since :meth:`ultraplot.axes.PolarAxes.format`
52+
# calls :meth:`ultraplot.axes.Axes.format`, it can be used to add axes titles, a-b-c
5353
# labels, and figure titles.
5454
#
55-
# For details, see `ultraplot.axes.PolarAxes.format`.
55+
# For details, see :meth:`ultraplot.axes.PolarAxes.format`.
5656

5757
# %%
5858
import ultraplot as uplt
@@ -114,16 +114,16 @@
114114
# ---------------
115115
#
116116
# To create geographic axes, pass ``proj='name'`` to an axes-creation command like
117-
# `ultraplot.figure.Figure.add_subplot`, where ``name`` is any valid :ref:`PROJ projection
118-
# name <proj_table>`. Alternatively, you can pass a `cartopy.crs.Projection` or
119-
# `~mpl_toolkits.basemap.Basemap` instance returned by the :class:`~ultraplot.constructor.Proj`
117+
# :meth:`ultraplot.figure.Figure.add_subplot`, where ``name`` is any valid :ref:`PROJ projection
118+
# name <proj_table>`. Alternatively, you can pass a :class:`cartopy.crs.Projection` or
119+
# :class:`~mpl_toolkits.basemap.Basemap` instance returned by the :class:`~ultraplot.constructor.Proj`
120120
# :ref:`constructor function <why_constructor>` to `proj` (see below for details). If
121121
# you want to create your subplots :ref:`all-at-once <ug_subplot>` with e.g.
122122
# :func:`~ultraplot.ui.subplots` but need different projections for each subplot, you can pass
123123
# a list or dictionary to the `proj` keyword (e.g., ``proj=('cartesian', 'pcarree')``
124124
# or ``proj={2: 'pcarree'}`` -- see :func:`~ultraplot.figure.Figure.subplots` for details).
125-
# Geographic axes are represented with the `~ultraplot.axes.GeoAxes` subclass, which
126-
# has its own :func:`~ultraplot.axes.GeoAxes.format` command. `ultraplot.axes.GeoAxes.format`
125+
# Geographic axes are represented with the :class:`~ultraplot.axes.GeoAxes` subclass, which
126+
# has its own :meth:`~ultraplot.axes.GeoAxes.format` command. :meth:`ultraplot.axes.GeoAxes.format`
127127
# facilitates :ref:`geographic-specific modifications <ug_geoformat>` like meridional
128128
# and parallel gridlines and land mass outlines. The syntax is very similar to
129129
# :func:`ultraplot.axes.CartesianAxes.format`. Note that the `proj` keyword and several of
@@ -151,78 +151,75 @@
151151
# Geographic backends
152152
# -------------------
153153
#
154-
# The `ultraplot.axes.GeoAxes` class uses either `cartopy`_ or `basemap`_ as "backends"
154+
# The :class:`ultraplot.axes.GeoAxes` class uses either `cartopy`_ or `basemap`_ as "backends"
155155
# to :ref:`format the axes <ug_geoformat>` and :ref:`plot stuff <ug_geoplot>` in
156156
# the axes. A few details:
157157
#
158158
# * Cartopy is the default backend. When you request projection names with cartopy
159-
# as the backend (or pass a `cartopy.crs.Projection` to the `proj` keyword), the
160-
# returned axes is a subclass of `cartopy.mpl.geoaxes.GeoAxes`. Under the hood,
159+
# as the backend (or pass a :class:`cartopy.crs.Projection` to the `proj` keyword), the
160+
# returned axes is a subclass of :class:`cartopy.mpl.geoaxes.GeoAxes`. Under the hood,
161161
# invoking :func:`~ultraplot.axes.GeoAxes.format` with cartopy as the backend changes map
162-
# bounds using `~cartopy.mpl.geoaxes.GeoAxes.set_extent`, adds major and minor
163-
# gridlines using `~cartopy.mpl.geoaxes.GeoAxes.gridlines`, and adds geographic
164-
# features using `~cartopy.mpl.geoaxes.GeoAxes.add_feature`. If you prefer, you can
165-
# use the standard `cartopy.mpl.geoaxes.GeoAxes` methods just like you would in
166-
# cartopy. If you need to use the underlying `~cartopy.crs.Projection` instance, it
162+
# bounds using :meth:`~cartopy.mpl.geoaxes.GeoAxes.set_extent`, adds major and minor
163+
# gridlines using :mod:`~cartopy.mpl.geoaxes.GeoAxes.gridlines`, and adds geographic
164+
# features using :meth:`~cartopy.mpl.geoaxes.GeoAxes.add_feature`. If you prefer, you can
165+
# use the standard :class:`cartopy.mpl.geoaxes.GeoAxes` methods just like you would in
166+
# cartopy. If you need to use the underlying :class:`~cartopy.crs.Projection` instance, it
167167
# is available via the :func:`~ultraplot.axes.GeoAxes.projection` attribute. If you want
168168
# to work with the projection classes directly, they are available in the
169169
# top-level namespace (e.g., ``proj=uplt.PlateCarre()`` is allowed).
170170
#
171171
# * Basemap is an alternative backend. To use basemap, set :rcraw:`geo.backend` to
172172
# ``'basemap'`` or pass ``backend='basemap'`` to the axes-creation command. When
173173
# you request a projection name with basemap as the backend (or pass a
174-
# `~mpl_toolkits.basemap.Basemap` to the `proj` keyword), the returned axes
174+
# :class:`~mpl_toolkits.basemap.Basemap` to the `proj` keyword), the returned axes
175175
# redirects the plotting methods plot, scatter, contour, contourf, pcolor,
176176
# pcolormesh, quiver, streamplot, and barb to the identically named methods on
177-
# the `~mpl_toolkits.basemap.Basemap` instance. This means you can work
177+
# the :class:`~mpl_toolkits.basemap.Basemap` instance. This means you can work
178178
# with the standard axes plotting methods rather than the basemap methods --
179179
# just like cartopy. Under the hood, invoking :func:`~ultraplot.axes.GeoAxes.format`
180180
# with basemap as the backend adds major and minor gridlines using
181-
# :func:`~mpl_toolkits.basemap.Basemap.drawmeridians` and
182-
# :func:`~mpl_toolkits.basemap.Basemap.drawparallels` and adds geographic features
183-
# using methods like :func:`~mpl_toolkits.basemap.Basemap.fillcontinents`
184-
# and :func:`~mpl_toolkits.basemap.Basemap.drawcoastlines`. If you need to
185-
# use the underlying `~mpl_toolkits.basemap.Basemap` instance, it is
186-
# available as the :func:`~ultraplot.axes.GeoAxes.projection` attribute.
181+
# :meth:`~mpl_toolkits.basemap.Basemap.drawmeridians` and
182+
# :meth:`~mpl_toolkits.basemap.Basemap.drawparallels` and adds geographic features
183+
# using methods like :meth:`~mpl_toolkits.basemap.Basemap.fillcontinents`
184+
# and :meth:`~mpl_toolkits.basemap.Basemap.drawcoastlines`. If you need to
185+
# use the underlying :class:`~mpl_toolkits.basemap.Basemap` instance, it is
186+
# available as the :attr:`~ultraplot.axes.GeoAxes.projection` attribute.
187187
#
188188
# Together, these features let you work with geophysical data without invoking
189-
# verbose cartopy classes like `~cartopy.crs.LambertAzimuthalEqualArea` or
190-
# keeping track of separate `~mpl_toolkits.basemap.Basemap` instances. This
189+
# verbose cartopy classes like :calss:`~cartopy.crs.LambertAzimuthalEqualArea` or
190+
# keeping track of separate :class:`~mpl_toolkits.basemap.Basemap` instances. This
191191
# considerably reduces the amount of code needed to make complex geographic
192192
# plots. In the below examples, we create a variety of plots using both
193193
# cartopy and basemap as backends.
194194
#
195195
# .. important::
196196
#
197197
# * By default, UltraPlot bounds polar cartopy projections like
198-
# `~cartopy.crs.NorthPolarStereo` at the equator and gives non-polar cartopy
199-
# projections global extent by calling `~cartopy.mpl.geoaxes.GeoAxes.set_global`.
198+
# :classs:`~cartopy.crs.NorthPolarStereo` at the equator and gives non-polar cartopy
199+
# projections global extent by calling :meth:`~cartopy.mpl.geoaxes.GeoAxes.set_global`.
200200
# This is a deviation from cartopy, which determines map boundaries automatically
201201
# based on the coordinates of the plotted content. To revert to cartopy's
202202
# default behavior, set :rcraw:`geo.extent` to ``'auto`` or pass ``extent='auto'``
203203
# to :func:`~ultraplot.axes.GeoAxes.format`.
204204
# * By default, UltraPlot gives circular boundaries to polar cartopy and basemap
205-
# projections like `~cartopy.crs.NorthPolarStereo` (see `this example
205+
# projections like :class:`~cartopy.crs.NorthPolarStereo` (see `this example
206206
# <https://scitools.org.uk/cartopy/docs/latest/gallery/lines_and_polygons/always_circular_stereo.html>`__
207207
# from the cartopy website). To disable this feature, set :rcraw:`geo.round` to
208208
# ``False`` or pass ``round=False` to :func:`~ultraplot.axes.GeoAxes.format`. Please note
209209
# that older versions of cartopy cannot add gridlines to maps bounded by circles.
210210
# * To make things more consistent, the :class:`~ultraplot.constructor.Proj` constructor
211211
# function lets you supply native `PROJ <https://proj.org>`__ keyword names
212-
# for the cartopy `~cartopy.crs.Projection` classes (e.g., `lon0` instead
213-
# of `central_longitude`) and instantiates `~mpl_toolkits.basemap.Basemap`
212+
# for the cartopy :class:`~cartopy.crs.Projection` classes (e.g., `lon0` instead
213+
# of `central_longitude`) and instantiates :class:`~mpl_toolkits.basemap.Basemap`
214214
# projections with sensible default PROJ parameters rather than raising an error
215215
# when they are omitted (e.g., ``lon0=0`` as the default for most projections).
216216
#
217217
# .. warning::
218-
#
219-
# The `basemap`_ package is `no longer actively maintained \
220-
# <https://matplotlib.org/basemap/users/intro.html#cartopy-new-management-and-eol-announcement>`__
221-
# and will not work with matplotlib versions more recent than 3.2.2. We originally
218+
# The `basemap`_ package is now being actively maintained again witha short hiatus for a few years. We originally
222219
# included basemap support because its gridline labeling was more powerful
223-
# than cartopy gridline labeling. However, as cartopy gridline labeling has
224-
# significantly improved since version 0.18, UltraPlot may deprecate basemap support
225-
# in a future release and fully remove basemap support by version 1.0.0.
220+
# than cartopy gridline labeling. While cartopy gridline labeling has
221+
# significantly improved since version 0.18, UltraPlot continues to support
222+
# both mapping libraries to give users flexibility in their visualization choices.
226223

227224
# %%
228225
import ultraplot as uplt
@@ -258,19 +255,19 @@
258255
# -----------------------
259256
#
260257
# In UltraPlot, plotting with `~ultraplot.axes.GeoAxes` is just like plotting
261-
# with `~ultraplot.axes.CartesianAxes`. UltraPlot makes longitude-latitude
258+
# with :class:`~ultraplot.axes.CartesianAxes`. UltraPlot makes longitude-latitude
262259
# (i.e., Plate Carrée) coordinates the *default* coordinate system for all plotting
263260
# commands by internally passing ``transform=ccrs.PlateCarree()`` to cartopy commands
264261
# and ``latlon=True`` to basemap commands. And again, when `basemap`_ is the backend,
265262
# plotting is done "cartopy-style" by calling methods from the `ultraplot.axes.GeoAxes`
266-
# instance rather than the `~mpl_toolkits.basemap.Basemap` instance.
263+
# instance rather than the :class:`~mpl_toolkits.basemap.Basemap` instance.
267264
#
268265
# To ensure that a 2D :class:`~ultraplot.axes.PlotAxes` command like
269266
# :func:`~ultraplot.axes.PlotAxes.contour` or :func:`~ultraplot.axes.PlotAxes.pcolor`
270267
# fills the entire globe, simply pass ``globe=True`` to the command.
271268
# This interpolates the data to the North and South poles and across the longitude
272269
# seam before plotting. This is a convenient and succinct alternative to cartopy's
273-
# `~cartopy.util.add_cyclic_point` and basemap's :func:`~mpl_toolkits.basemap.addcyclic`.
270+
# :meth:`~cartopy.util.add_cyclic_point` and basemap's :meth:`~mpl_toolkits.basemap.addcyclic`.
274271
#
275272
# To draw content above or underneath a given geographic feature, simply change
276273
# the `zorder <https://matplotlib.org/3.1.1/gallery/misc/zorder_demo.html>`__
@@ -329,7 +326,7 @@
329326
# latitude gridline locations using the `grid`, `lonlocator`, `latlocator`, `gridminor`,
330327
# `lonminorlocator`, and `latminorlocator` keys, and configure gridline label formatting
331328
# with `lonformatter` and `latformatter` (analogous to `xlocator`, `xminorlocator`,
332-
# and `xformatter` used by :func:`ultraplot.axes.CartesianAxes.format`). By default, inline
329+
# and `xformatter` used by :meth:`ultraplot.axes.CartesianAxes.format`). By default, inline
333330
# cartopy labels and cartopy label rotation are turned off, but inline labels can
334331
# be turned on using ``loninline=True``, ``latinline=True``, or ``inlinelabels=True``
335332
# or by setting :rcraw:`grid.inlinelabels` to ``True``, and label rotation can be
@@ -342,11 +339,11 @@
342339
# latitude bound for circular polar projections using `boundinglat`, and toggle and
343340
# configure geographic features like land masses, coastlines, and administrative
344341
# borders using :ref:`settings <rc_UltraPlot>` like `land`, `landcolor`, `coast`,
345-
# `coastcolor`, and `coastlinewidth`. Finally, since `ultraplot.axes.GeoAxes.format`
346-
# calls `ultraplot.axes.Axes.format`, it can be used to add axes titles, a-b-c labels,
342+
# `coastcolor`, and `coastlinewidth`. Finally, since :meth:`ultraplot.axes.GeoAxes.format`
343+
# calls :meth:`ultraplot.axes.Axes.format`, it can be used to add axes titles, a-b-c labels,
347344
# and figure titles, just like :func:`ultraplot.axes.CartesianAxes.format`. UltraPlot also adds the ability to add tick marks for longitude and latitude using the keywords `lontick` and `lattick` for rectilinear projections only. This can enhance contrast and readability under some conditions, e.g. when overlaying contours.
348345
#
349-
# For details, see the `ultraplot.axes.GeoAxes.format` documentation.
346+
# For details, see the :meth:`ultraplot.axes.GeoAxes.format` documentation.
350347

351348
# %%
352349
import ultraplot as uplt
@@ -422,14 +419,14 @@
422419
# ------------------------
423420
#
424421
# To zoom into cartopy projections, use
425-
# `~cartopy.mpl.geoaxes.GeoAxes.set_extent` or pass `lonlim`,
426-
# `latlim`, or `boundinglat` to :func:`~ultraplot.axes.GeoAxes.format`. The `boundinglat`
422+
# :meth:`~cartopy.mpl.geoaxes.GeoAxes.set_extent` or pass `lonlim`,
423+
# `latlim`, or `boundinglat` to :meth:`~ultraplot.axes.GeoAxes.format`. The `boundinglat`
427424
# keyword controls the circular latitude boundary for North Polar and
428425
# South Polar Stereographic, Azimuthal Equidistant, Lambert Azimuthal
429426
# Equal-Area, and Gnomonic projections. By default, UltraPlot tries to use the
430427
# degree-minute-second cartopy locators and formatters made available in cartopy
431428
# 0.18. You can switch from minute-second subintervals to traditional decimal
432-
# subintervals by passing ``dms=False`` to :func:`~ultraplot.axes.GeoAxes.format`
429+
# subintervals by passing ``dms=False`` to :meth:`~ultraplot.axes.GeoAxes.format`
433430
# or by setting :rcraw:`grid.dmslabels` to ``False``.
434431
#
435432
# To zoom into basemap projections, pass any of the `boundinglat`,
@@ -521,8 +518,8 @@
521518
# and ``'kav7'``), as well as North and South polar versions of the Azimuthal
522519
# Equidistant, Lambert Azimuthal Equal-Area, and Gnomonic projections (i.e.,
523520
# ``'npaeqd'``, ``'spaeqd'``, ``'nplaea'``, ``'splaea'``, ``'npgnom'``, and
524-
# ``'spgnom'``), modeled after cartopy's existing `~cartopy.crs.NorthPolarStereo`
525-
# and `~cartopy.crs.SouthPolarStereo` projections.
521+
# ``'spgnom'``), modeled after cartopy's existing :class:`~cartopy.crs.NorthPolarStereo`
522+
# and :class:`~cartopy.crs.SouthPolarStereo` projections.
526523

527524
# %%
528525
import ultraplot as uplt

0 commit comments

Comments
 (0)