Skip to content

Commit c19e637

Browse files
committed
More docs cleanup
1 parent 55a6ada commit c19e637

File tree

9 files changed

+203
-204
lines changed

9 files changed

+203
-204
lines changed

docs/1dplots.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
# Plotting 1D data
1919
# ================
2020
#
21-
# ProPlot adds new features to various `~matplotlib.axes.Axes` plotting
22-
# methods using a set of "wrapper" functions. When a plotting method like
23-
# `~matplotlib.axes.Axes.plot` is "wrapped" by one of these functions, it
24-
# accepts the same parameters as the wrapper. These additions are a strict
25-
# *superset* of matplotlib -- if you are not interested, you
26-
# can use matplotlib's plotting methods just like you always have.
27-
# This section documents the features added by wrapper functions to 1D
28-
# plotting commands like `~matplotlib.axes.Axes.plot`,
21+
# ProPlot :ref:`adds new features <why_plotting>` to various `~matplotlib.axes.Axes`
22+
# plotting methods using a set of "wrapper" functions. When a plotting method like
23+
# `~matplotlib.axes.Axes.plot` is "wrapped" by one of these functions, it accepts
24+
# the same parameters as the wrapper. These additions are a strict *superset* of
25+
# matplotlib -- if you are not interested, you can use matplotlib's plotting methods
26+
# just like you always have. This section documents the features added by wrapper
27+
# functions to 1D plotting commands like `~matplotlib.axes.Axes.plot`,
2928
# `~matplotlib.axes.Axes.scatter`, `~matplotlib.axes.Axes.bar`, and
3029
# `~matplotlib.axes.Axes.barh`.
3130

docs/2dplots.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
# Plotting 2D data
1919
# ================
2020
#
21-
# ProPlot adds new features to various `~matplotlib.axes.Axes` plotting
22-
# methods using a set of wrapper functions. When a plotting method like
23-
# `~matplotlib.axes.Axes.contourf` is "wrapped" by one of these functions, it
24-
# accepts the same parameters as the wrapper. These additions are a strict
25-
# *superset* of matplotlib -- if you are not interested, you
26-
# can use matplotlib's plotting methods just like you always have.
27-
# This section documents the features added by wrapper functions to 2D
28-
# plotting commands like `~matplotlib.axes.Axes.contour`,
21+
# ProPlot :ref:`adds new features <why_plotting>` to various `~matplotlib.axes.Axes`
22+
# plotting methods using a set of "wrapper" functions. When a plotting method like
23+
# `~matplotlib.axes.Axes.contourf` is "wrapped" by one of these functions, it accepts
24+
# the same parameters as the wrapper. These additions are a strict *superset* of
25+
# matplotlib -- if you are not interested, you can use matplotlib's plotting methods
26+
# just like you always have. This section documents the features added by wrapper
27+
# functions to 2D plotting commands like `~matplotlib.axes.Axes.contour`,
2928
# `~matplotlib.axes.Axes.contourf`, `~matplotlib.axes.Axes.pcolor`, and
3029
# `~matplotlib.axes.Axes.pcolormesh`.
3130

docs/basics.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,10 @@
263263
# 2D indexing (e.g., ``axs[0, 1]``), and is row-major by default. Slicing a
264264
# `~proplot.ui.SubplotsContainer` returns another container (e.g., ``axs[:, 0]``).
265265
#
266-
# `~proplot.ui.SubplotsContainer` is useful because it lets you call
267-
# `~proplot.axes.Axes` methods simultaneously for all subplots in the container.
268-
# In the below example, we use the `~proplot.ui.SubplotsContainer` returned by
269-
# `~proplot.ui.subplots` with the `proplot.axes.Axes.format` command to format
270-
# several subplots at once.
266+
# `~proplot.ui.SubplotsContainer` also lets you call `~proplot.axes.Axes` methods
267+
# simultaneously for all subplots in the container. In the below example, we use the
268+
# `~proplot.ui.SubplotsContainer` returned by `~proplot.ui.subplots` with the
269+
# `proplot.axes.Axes.format` command to format several subplots at once.
271270

272271
# %%
273272
import proplot as plot

docs/colorbars_legends.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# =====================
2020
#
2121
# ProPlot includes some useful improvements to the matplotlib API that make
22-
# working with colorbars and legends much easier.
22+
# working with colorbars and legends :ref:`much easier <why_colorbars_legends>`.
2323

2424

2525
# %% [raw] raw_mimetype="text/restructuredtext"
@@ -28,11 +28,11 @@
2828
# Axes colorbars and legends
2929
# --------------------------
3030
#
31-
# In matplotlib, colorbars are added to the edges of subplots with the *figure* method
32-
# `matplotlib.figure.Figure.colorbar` using e.g.
33-
# ``fig.colorbar(m, ax=ax, location='right')``.
34-
# In ProPlot, colorbars are added using the axes method
35-
# `proplot.axes.Axes.colorbar` with e.g. ``ax.colorbar(m, loc='r')``.
31+
# In matplotlib, colorbars are added to the edges of subplots using the figure
32+
# method `matplotlib.figure.Figure.colorbar`
33+
# (e.g., ``fig.colorbar(m, ax=ax, location='right')``.
34+
# In ProPlot, this is done using the axes method
35+
# `proplot.axes.Axes.colorbar` (e.g., ``ax.colorbar(m, loc='r')``.
3636
# `proplot.axes.Axes.colorbar` preserves subplot aspect ratios and visual
3737
# symmetry between subplots by allocating new space in the figure
3838
# `~proplot.gridspec.GridSpec` rather than "stealing" space from the parent subplot

docs/colormaps.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
# :ref:`subclassed from <ug_cmaps_new>`
2828
# `matplotlib.colors.LinearSegmentedColormap`.
2929
#
30-
# ProPlot adds several features to help you use colormaps effectively in your
31-
# figures. This section documents the new registered colormaps, explains how
32-
# to make and modify colormaps, and shows how to apply them to your plots.
30+
# ProPlot :ref:`adds several features <why_colormaps_cyles>` to help you use
31+
# colormaps effectively in your figures. This section documents the new registered
32+
# colormaps, explains how to make and modify colormaps, and shows how to apply them
33+
# to your plots.
3334

3435

3536
# %% [raw] raw_mimetype="text/restructuredtext"

docs/cycles.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
# `~proplot.constructor.Cycle` constructor function or by
3232
# :ref:`drawing samples <ug_cycles_new>` from continuous colormaps.
3333
#
34-
# ProPlot adds several features to help you use color cycles effectively in
35-
# your figures. This section documents the new registered color cycles,
36-
# explains how to make and modify colormaps, and shows how to apply them to
37-
# your plots.
34+
# ProPlot :ref:`adds several features <why_colormaps_cyles>` to help you use color
35+
# cycles effectively in your figures. This section documents the new registered
36+
# color cycles, explains how to make and modify colormaps, and shows how to apply
37+
# them to your plots.
3838

3939

4040
# %% [raw] raw_mimetype="text/restructuredtext"

docs/projections.py

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
# ==========================
2828
#
2929
# ProPlot includes features for working with `polar axes <polar_>`_ and the
30-
# `cartopy`_ and `basemap`_ geographic projection packages. These features are
31-
# optional -- installation of cartopy or basemap is not required.
30+
# `cartopy`_ and `basemap`_ :ref:`geographic projection packages <why_cartopy_basemap>`.
31+
# These features are *optional*. Installation of cartopy or basemap is not required.
3232
#
3333
# To change the axes projection, pass ``proj='name'`` to `~proplot.ui.subplots`. To use
3434
# different projections for different subplots, pass a dictionary of projection names
@@ -56,7 +56,6 @@
5656
# `proplot.axes.PolarAxes.format` calls `proplot.axes.Axes.format`, it can be used to
5757
# add axes titles, a-b-c labels, and figure titles, just like
5858
# `~proplot.axes.CartesianAxes`.
59-
6059
#
6160
# For details, see `proplot.axes.PolarAxes.format`.
6261

@@ -102,43 +101,46 @@
102101
# Geographic axes
103102
# ---------------
104103
#
105-
# ProPlot can create geographic projection axes using either `cartopy`_ or `basemap`_
106-
# as "backends". To draw geographic axes, pass ``proj='name'`` or e.g.
107-
# ``proj={2: 'name'}`` (:ref:`see above <ug_proj>`) to `~proplot.ui.subplots`
108-
# where ``name`` is any valid :ref:`PROJ projection name <proj_included>`.
109-
# You can also use ``proj=projection_instance``, where ``projection_instance``
110-
# is a `cartopy.crs.Projection` or `mpl_toolkits.basemap.Basemap` returned by
111-
# the `~proplot.constructor.Proj` constructor function.
104+
# ProPlot can create geographic projection axes using
105+
# either `cartopy`_ or `basemap`_ as "backends". To draw geographic axes, pass
106+
# ``proj='name'`` or e.g. ``proj={2: 'name'}`` (:ref:`see above <ug_proj>`) to
107+
# `~proplot.ui.subplots` where ``name`` is any valid :ref:`PROJ projection name
108+
# <proj_included>`. You can also use ``proj=projection_instance``, where
109+
# ``projection_instance`` is a `cartopy.crs.Projection` or
110+
# `mpl_toolkits.basemap.Basemap` returned by the `~proplot.constructor.Proj`
111+
# :ref:`constructor function <why_constructor>`.
112112
#
113113
# When you request a geographic projection, `~proplot.ui.subplots` returns
114114
# a `proplot.axes.GeoAxes` instance with its own `~proplot.axes.GeoAxes.format`
115-
# method. The `proplot.axes.GeoAxes.format` method allows you to
116-
# :ref:`modify geographic features <ug_geoformat>` with the same syntax whether
117-
# cartopy or basemap is the "backend". A few details:
115+
# method. The `proplot.axes.GeoAxes.format` method lets you
116+
# :ref:`modify geographic features <ug_geoformat>` with the same syntax for
117+
# either backend. A few details:
118118
#
119119
# * Cartopy is the default backend. When you request projections with cartopy as the
120120
# backend, `~proplot.ui.subplots` returns `proplot.axes.CartopyAxes`, which is a
121-
# subclass of both `cartopy.mpl.geoaxes.GeoAxes` and `proplot.axes.Axes.GeoAxes`.
122-
# On `~proplot.axes.CartopyAxes`, `~proplot.axes.GeoAxes.format` changes map
123-
# bounds using `~cartopy.mpl.geoaxes.GeoAxes.set_extent`, adds major and minor
124-
# gridlines using `~cartopy.mpl.geoaxes.GeoAxes.gridlines`, and adds geographic
125-
# features using `~cartopy.mpl.geoaxes.GeoAxes.add_feature`.
126-
#
127-
# * Basemap is an alternative backend. To use basemap as the backend, set the
128-
# :rcraw:`basemap` setting to ``True`` or pass ``basemap=True`` to
129-
# `~proplot.ui.subplots`. When you request projections with basemap as the backend,
130-
# `~proplot.ui.subplots` returns `proplot.axes.BasemapAxes`, which is a subclass
131-
# of `proplot.axes.GeoAxes`. `~proplot.axes.Axes.BasemapAxes` redirects the plot,
132-
# scatter, contour, contourf, pcolor, pcolormesh, quiver, streamplot, and barb
133-
# methods to identically named methods on the `~mpl_toolkits.basemap.Basemap`
134-
# instance. This means you can work with the standard axes plotting methods rather
135-
# than the basemap methods -- just like cartopy. On `~proplot.axes.BasemapAxes`,
136-
# `~proplot.axes.GeoAxes.format` adds adds major and minor gridlines using
121+
# subclass of both `proplot.axes.GeoAxes` and `cartopy.mpl.geoaxes.GeoAxes`.
122+
# Under the hood, invoking `~proplot.axes.GeoAxes.format` on a
123+
# `~proplot.axes.CartopyAxes` changes map bounds using
124+
# `~cartopy.mpl.geoaxes.GeoAxes.set_extent`, adds major and minor gridlines using
125+
# `~cartopy.mpl.geoaxes.GeoAxes.gridlines`, and adds geographic features using
126+
# `~cartopy.mpl.geoaxes.GeoAxes.add_feature`. If you prefer, you can use the
127+
# standard `cartopy.mpl.geoaxes.GeoAxes` methods just like you would in cartopy.
128+
#
129+
# * Basemap is an alternative backend. To use basemap, set :rcraw:`basemap` to
130+
# ``True`` or pass ``basemap=True`` to `~proplot.ui.subplots`. When you request
131+
# projections with basemap as the backend, `~proplot.ui.subplots` returns
132+
# `proplot.axes.BasemapAxes`, which is a subclass of `proplot.axes.GeoAxes`.
133+
# `~proplot.axes.BasemapAxes` redirects the plot, scatter, contour, contourf,
134+
# pcolor, pcolormesh, quiver, streamplot, and barb methods to identically named
135+
# methods on the `~mpl_toolkits.basemap.Basemap` instance. This means you can work
136+
# with the standard axes plotting methods rather than the basemap methods -- just
137+
# like cartopy. Under the hood, invoking `~proplot.axes.GeoAxes.format` on a
138+
# `~proplot.axes.BasemapAxes` adds major and minor gridlines using
137139
# `~mpl_toolkits.basemap.Basemap.drawmeridians` and
138140
# `~mpl_toolkits.basemap.Basemap.drawparallels` and adds geographic features
139141
# using methods like `~mpl_toolkits.basemap.Basemap.fillcontinents`
140-
# and `~mpl_toolkits.basemap.Basemap.drawcoastlines`. In case you need to
141-
# explicitly use the underlying `~mpl_toolkits.basemap.Basemap` instance, it is
142+
# and `~mpl_toolkits.basemap.Basemap.drawcoastlines`. If you need to
143+
# use the underlying `~mpl_toolkits.basemap.Basemap` instance, it is
142144
# available via the `proplot.axes.BasemapAxes.projection` attribute.
143145
#
144146
# Together, these features let you work with geophysical data without invoking

docs/subplots.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@
227227
# Axis sharing
228228
# ------------
229229
#
230-
# Redundant labels are a common problem for figures with lots of subplots. To
231-
# address this, `matplotlib.pyplot.subplots` includes `sharex` and `sharey` keywords
232-
# that permit sharing axis limits, ticks, and tick labels between like rows and columns
233-
# of subplots. ProPlot expands upon this feature by:
230+
# :ref:`Redundant labels <why_redundant>` are a common problem for figures with lots of
231+
# subplots. To address this, `matplotlib.pyplot.subplots` includes `sharex` and `sharey`
232+
# keywords that permit sharing axis limits, ticks, and tick labels between like rows and
233+
# columns of subplots. ProPlot expands upon this feature by:
234234

235235
# 1. Adding an option for sharing labels in the same row or column of the subplot grid,
236236
# controlled by the `spanx` and `spany` keywords (default is :rc:`subplots.span`).

0 commit comments

Comments
 (0)