Skip to content

Commit 34b467b

Browse files
authored
separate arg types from descriptions (#4100)
1 parent ba62453 commit 34b467b

File tree

2 files changed

+75
-61
lines changed

2 files changed

+75
-61
lines changed

docs/src/whatsnew/latest.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ This document explains the changes made to Iris for this release
116116
#. `@bjlittle`_ added the |pre-commit.ci|_ badge to the `README.md`_.
117117
See :ref:`pre_commit_ci` for further details. (:pull:`4061`)
118118

119+
#. `@rcomer`_ tweaked docstring layouts in the :mod:`iris.plot` module, so
120+
they render better in the published documentation. See :issue:`4085`.
121+
(:pull:`4100`)
122+
119123

120124
💼 Internal
121125
===========

lib/iris/plot.py

Lines changed: 71 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,15 +1014,16 @@ def contour(cube, *args, **kwargs):
10141014
10151015
Kwargs:
10161016
1017-
* coords: list of :class:`~iris.coords.Coord` objects or
1018-
coordinate names. Use the given coordinates as the axes for the
1017+
* coords: list of :class:`~iris.coords.Coord` objects or coordinate names
1018+
Use the given coordinates as the axes for the
10191019
plot. The order of the given coordinates indicates which axis
10201020
to use for each, where the first element is the horizontal
10211021
axis of the plot and the second element is the vertical axis
10221022
of the plot.
10231023
1024-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1025-
Defaults to the current axes if none provided.
1024+
* axes: :class:`matplotlib.axes.Axes`
1025+
The axes to use for drawing. Defaults to the current axes if none
1026+
provided.
10261027
10271028
See :func:`matplotlib.pyplot.contour` for details of other valid
10281029
keyword arguments.
@@ -1038,15 +1039,15 @@ def contourf(cube, *args, **kwargs):
10381039
10391040
Kwargs:
10401041
1041-
* coords: list of :class:`~iris.coords.Coord` objects or
1042-
coordinate names. Use the given coordinates as the axes for the
1043-
plot. The order of the given coordinates indicates which axis
1044-
to use for each, where the first element is the horizontal
1045-
axis of the plot and the second element is the vertical axis
1046-
of the plot.
1042+
* coords: list of :class:`~iris.coords.Coord` objects or coordinate names
1043+
Use the given coordinates as the axes for the plot. The order of the
1044+
given coordinates indicates which axis to use for each, where the first
1045+
element is the horizontal axis of the plot and the second element is
1046+
the vertical axis of the plot.
10471047
1048-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1049-
Defaults to the current axes if none provided.
1048+
* axes: :class:`matplotlib.axes.Axes`
1049+
The axes to use for drawing. Defaults to the current axes if none
1050+
provided.
10501051
10511052
See :func:`matplotlib.pyplot.contourf` for details of other valid
10521053
keyword arguments.
@@ -1127,10 +1128,10 @@ def default_projection_extent(cube, mode=iris.coords.POINT_MODE):
11271128
11281129
Keyword arguments:
11291130
1130-
* mode - Either ``iris.coords.POINT_MODE`` or ``iris.coords.BOUND_MODE``.
1131-
Triggers whether the extent should be representative of the cell
1132-
points, or the limits of the cell's bounds.
1133-
The default is iris.coords.POINT_MODE.
1131+
* mode: Either ``iris.coords.POINT_MODE`` or ``iris.coords.BOUND_MODE``
1132+
Triggers whether the extent should be representative of the cell
1133+
points, or the limits of the cell's bounds.
1134+
The default is iris.coords.POINT_MODE.
11341135
11351136
"""
11361137
extents = cartography._xy_range(cube, mode)
@@ -1229,23 +1230,24 @@ def outline(cube, coords=None, color="k", linewidth=None, axes=None):
12291230
12301231
Kwargs:
12311232
1232-
* coords: list of :class:`~iris.coords.Coord` objects or
1233-
coordinate names. Use the given coordinates as the axes for the
1233+
* coords: list of :class:`~iris.coords.Coord` objects or coordinate names
1234+
Use the given coordinates as the axes for the
12341235
plot. The order of the given coordinates indicates which axis
12351236
to use for each, where the first element is the horizontal
12361237
axis of the plot and the second element is the vertical axis
12371238
of the plot.
12381239
1239-
* color: None or mpl color The color of the cell outlines. If
1240-
None, the matplotlibrc setting patch.edgecolor is used by
1241-
default.
1240+
* color: None or mpl color
1241+
The color of the cell outlines. If None, the matplotlibrc setting
1242+
patch.edgecolor is used by default.
12421243
1243-
* linewidth: None or number The width of the lines showing the
1244-
cell outlines. If None, the default width in patch.linewidth
1245-
in matplotlibrc is used.
1244+
* linewidth: None or number
1245+
The width of the lines showing the cell outlines. If None, the default
1246+
width in patch.linewidth in matplotlibrc is used.
12461247
1247-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1248-
Defaults to the current axes if none provided.
1248+
* axes: :class:`matplotlib.axes.Axes`
1249+
The axes to use for drawing. Defaults to the current axes if none
1250+
provided.
12491251
12501252
"""
12511253
result = _draw_2d_from_bounds(
@@ -1276,18 +1278,20 @@ def pcolor(cube, *args, **kwargs):
12761278
12771279
Kwargs:
12781280
1279-
* coords: list of :class:`~iris.coords.Coord` objects or
1280-
coordinate names. Use the given coordinates as the axes for the
1281+
* coords: list of :class:`~iris.coords.Coord` objects or coordinate names
1282+
Use the given coordinates as the axes for the
12811283
plot. The order of the given coordinates indicates which axis
12821284
to use for each, where the first element is the horizontal
12831285
axis of the plot and the second element is the vertical axis
12841286
of the plot.
12851287
1286-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1287-
Defaults to the current axes if none provided.
1288+
* axes: :class:`matplotlib.axes.Axes`
1289+
The axes to use for drawing. Defaults to the current axes if none
1290+
provided.
12881291
1289-
* contiguity_tolerance: The absolute tolerance used when checking for
1290-
contiguity between the bounds of the cells. Defaults to None.
1292+
* contiguity_tolerance: float
1293+
The absolute tolerance used when checking for contiguity between the
1294+
bounds of the cells. Defaults to None.
12911295
12921296
See :func:`matplotlib.pyplot.pcolor` for details of other valid
12931297
keyword arguments.
@@ -1309,17 +1313,18 @@ def pcolormesh(cube, *args, **kwargs):
13091313
13101314
Kwargs:
13111315
1312-
* coords: list of :class:`~iris.coords.Coord` objects or
1313-
coordinate names. Use the given coordinates as the axes for the
1314-
plot. The order of the given coordinates indicates which axis
1315-
to use for each, where the first element is the horizontal
1316-
axis of the plot and the second element is the vertical axis
1317-
of the plot.
1316+
* coords: list of :class:`~iris.coords.Coord` objects or coordinate names
1317+
Use the given coordinates as the axes for the plot. The order of the
1318+
given coordinates indicates which axis to use for each, where the first
1319+
element is the horizontal axis of the plot and the second element is
1320+
the vertical axis of the plot.
13181321
1319-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1320-
Defaults to the current axes if none provided.
1322+
* axes: :class:`matplotlib.axes.Axes`
1323+
The axes to use for drawing. Defaults to the current axes if none
1324+
provided.
13211325
1322-
* contiguity_tolerance: The absolute tolerance used when checking for
1326+
* contiguity_tolerance: float
1327+
The absolute tolerance used when checking for
13231328
contiguity between the bounds of the cells. Defaults to None.
13241329
13251330
See :func:`matplotlib.pyplot.pcolormesh` for details of other
@@ -1336,15 +1341,16 @@ def points(cube, *args, **kwargs):
13361341
13371342
Kwargs:
13381343
1339-
* coords: list of :class:`~iris.coords.Coord` objects or
1340-
coordinate names. Use the given coordinates as the axes for the
1344+
* coords: list of :class:`~iris.coords.Coord` objects or coordinate names
1345+
Use the given coordinates as the axes for the
13411346
plot. The order of the given coordinates indicates which axis
13421347
to use for each, where the first element is the horizontal
13431348
axis of the plot and the second element is the vertical axis
13441349
of the plot.
13451350
1346-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1347-
Defaults to the current axes if none provided.
1351+
* axes: :class:`matplotlib.axes.Axes`
1352+
The axes to use for drawing. Defaults to the current axes if none
1353+
provided.
13481354
13491355
See :func:`matplotlib.pyplot.scatter` for details of other valid
13501356
keyword arguments.
@@ -1406,7 +1412,7 @@ def quiver(u_cube, v_cube, *args, **kwargs):
14061412
14071413
Args:
14081414
1409-
* u_cube, v_cube : (:class:`~iris.cube.Cube`)
1415+
* u_cube, v_cube : :class:`~iris.cube.Cube`
14101416
u and v vector components. Must have same shape and units.
14111417
If the cubes have geographic coordinates, the values are treated as
14121418
true distance differentials, e.g. windspeeds, and *not* map coordinate
@@ -1425,15 +1431,16 @@ def quiver(u_cube, v_cube, *args, **kwargs):
14251431
14261432
Kwargs:
14271433
1428-
* coords: (list of :class:`~iris.coords.Coord` or string)
1434+
* coords: list of :class:`~iris.coords.Coord` or string
14291435
Coordinates or coordinate names. Use the given coordinates as the axes
14301436
for the plot. The order of the given coordinates indicates which axis
14311437
to use for each, where the first element is the horizontal
14321438
axis of the plot and the second element is the vertical axis
14331439
of the plot.
14341440
1435-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1436-
Defaults to the current axes if none provided.
1441+
* axes: :class:`matplotlib.axes.Axes`
1442+
The axes to use for drawing. Defaults to the current axes if none
1443+
provided.
14371444
14381445
See :func:`matplotlib.pyplot.quiver` for details of other valid
14391446
keyword arguments.
@@ -1477,8 +1484,9 @@ def plot(*args, **kwargs):
14771484
14781485
Kwargs:
14791486
1480-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1481-
Defaults to the current axes if none provided.
1487+
* axes: :class:`matplotlib.axes.Axes`
1488+
The axes to use for drawing. Defaults to the current axes if none
1489+
provided.
14821490
14831491
See :func:`matplotlib.pyplot.plot` for details of additional valid
14841492
keyword arguments.
@@ -1508,8 +1516,9 @@ def scatter(x, y, *args, **kwargs):
15081516
15091517
Kwargs:
15101518
1511-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1512-
Defaults to the current axes if none provided.
1519+
* axes: :class:`matplotlib.axes.Axes`
1520+
The axes to use for drawing. Defaults to the current axes if none
1521+
provided.
15131522
15141523
See :func:`matplotlib.pyplot.scatter` for details of additional
15151524
valid keyword arguments.
@@ -1551,8 +1560,9 @@ def symbols(x, y, symbols, size, axes=None, units="inches"):
15511560
15521561
Kwargs:
15531562
1554-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1555-
Defaults to the current axes if none provided.
1563+
* axes: :class:`matplotlib.axes.Axes`
1564+
The axes to use for drawing. Defaults to the current axes if none
1565+
provided.
15561566
15571567
* units: ['inches', 'points']
15581568
The unit for the symbol size.
@@ -1604,17 +1614,17 @@ def citation(text, figure=None, axes=None):
16041614
16051615
Args:
16061616
1607-
* text:
1617+
* text: str
16081618
Citation text to be plotted.
16091619
16101620
Kwargs:
16111621
1612-
* figure:
1613-
Target :class:`matplotlib.figure.Figure` instance. Defaults
1614-
to the current figure if none provided.
1622+
* figure::class:`matplotlib.figure.Figure`
1623+
Target figure instance. Defaults to the current figure if none provided.
16151624
1616-
* axes: the :class:`matplotlib.axes.Axes` to use for drawing.
1617-
Defaults to the current axes if none provided.
1625+
* axes: :class:`matplotlib.axes.Axes`
1626+
The axes to use for drawing. Defaults to the current axes if none
1627+
provided.
16181628
16191629
"""
16201630

0 commit comments

Comments
 (0)