Skip to content

Commit a8d8915

Browse files
committed
DOC: Add summary lines to plot types.
IMHO it's meaningful to give a one-sentence summary on the individual pages, e.g. at https://matplotlib.org/stable/plot_types/basic/plot.html#sphx-glr-plot-types-basic-plot-py > Plot y versus x as lines and/or markers. > > See `plot`. is more helpful than just > See `plot`. Users can already decide if that's the correct function for them and whether it's worth following the link. Also, the first sentence is used in the tooltip on the index page, where the current "See ..." is not helpful. I believe it's ok to just copy the text. Automatic insertion or check for consistency are not worth the added effort. First, these summary lines change rarely. Second, even if we improve the method summary and forget to udpate here, nothing really bad happens; we've maybe a slightly less optimal description here, but that's still way better than no description at all. Semi-OT: I changed the barbs summary from > Plot a 2D field of barbs. to > Plot a 2D field of wind barbs. because, AFAIK these are only used for wind, and that makes the context more clear. People outside of metrology may not know what barbs are so giving that extra context is reasonable.
1 parent 1c4c9af commit a8d8915

28 files changed

+29
-2
lines changed

galleries/plot_types/arrays/barbs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=================
33
barbs(X, Y, U, V)
44
=================
5+
Plot a 2D field of wind barbs.
56
67
See `~matplotlib.axes.Axes.barbs`.
78
"""

galleries/plot_types/arrays/contour.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
================
33
contour(X, Y, Z)
44
================
5+
Plot contour lines.
56
67
See `~matplotlib.axes.Axes.contour`.
78
"""

galleries/plot_types/arrays/contourf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=================
33
contourf(X, Y, Z)
44
=================
5+
Plot filled contours.
56
67
See `~matplotlib.axes.Axes.contourf`.
78
"""

galleries/plot_types/arrays/imshow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=========
33
imshow(Z)
44
=========
5+
Display data as an image, i.e., on a 2D regular raster.
56
67
See `~matplotlib.axes.Axes.imshow`.
78
"""

galleries/plot_types/arrays/pcolormesh.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
===================
33
pcolormesh(X, Y, Z)
44
===================
5+
Create a pseudocolor plot with a non-regular rectangular grid.
56
67
`~.axes.Axes.pcolormesh` is more flexible than `~.axes.Axes.imshow` in that
78
the x and y vectors need not be equally spaced (indeed they can be skewed).

galleries/plot_types/arrays/quiver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==================
33
quiver(X, Y, U, V)
44
==================
5+
Plot a 2D field of arrows.
56
67
See `~matplotlib.axes.Axes.quiver`.
78
"""

galleries/plot_types/arrays/streamplot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
======================
33
streamplot(X, Y, U, V)
44
======================
5+
Draw streamlines of a vector flow.
56
67
See `~matplotlib.axes.Axes.streamplot`.
78
"""

galleries/plot_types/basic/fill_between.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=======================
33
fill_between(x, y1, y2)
44
=======================
5+
Fill the area between two horizontal curves.
56
67
See `~matplotlib.axes.Axes.fill_between`.
78
"""

galleries/plot_types/basic/plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==========
33
plot(x, y)
44
==========
5+
Plot y versus x as lines and/or markers.
56
67
See `~matplotlib.axes.Axes.plot`.
78
"""

galleries/plot_types/basic/scatter_plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=============
33
scatter(x, y)
44
=============
5+
A scatter plot of y vs. x with varying marker size and/or color.
56
67
See `~matplotlib.axes.Axes.scatter`.
78
"""

galleries/plot_types/basic/stackplot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
===============
33
stackplot(x, y)
44
===============
5+
Draw a stacked area plot or a streamgraph.
6+
57
See `~matplotlib.axes.Axes.stackplot`
68
"""
79
import matplotlib.pyplot as plt

galleries/plot_types/basic/stairs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==============
33
stairs(values)
44
==============
5+
A stepwise constant function as a line with bounding edges or a filled plot.
56
67
See `~matplotlib.axes.Axes.stairs` when plotting :math:`y` between
78
:math:`(x_i, x_{i+1})`. For plotting :math:`y` at :math:`x`, see

galleries/plot_types/basic/stem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==========
33
stem(x, y)
44
==========
5+
Create a stem plot.
56
67
See `~matplotlib.axes.Axes.stem`.
78
"""

galleries/plot_types/stats/boxplot_plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==========
33
boxplot(X)
44
==========
5+
Draw a box and whisker plot.
56
67
See `~matplotlib.axes.Axes.boxplot`.
78
"""

galleries/plot_types/stats/ecdf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=======
33
ecdf(x)
44
=======
5+
Compute and plot the empirical cumulative distribution function of x.
56
67
See `~matplotlib.axes.Axes.ecdf`.
78
"""

galleries/plot_types/stats/errorbar_plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==========================
33
errorbar(x, y, yerr, xerr)
44
==========================
5+
Plot y versus x as lines and/or markers with attached errorbars.
56
67
See `~matplotlib.axes.Axes.errorbar`.
78
"""

galleries/plot_types/stats/eventplot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
============
33
eventplot(D)
44
============
5+
Plot identical parallel lines at the given positions.
56
67
See `~matplotlib.axes.Axes.eventplot`.
78
"""

galleries/plot_types/stats/hexbin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
===============
33
hexbin(x, y, C)
44
===============
5+
Make a 2D hexagonal binning plot of points x, y.
56
67
See `~matplotlib.axes.Axes.hexbin`.
78
"""

galleries/plot_types/stats/hist2d.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
============
33
hist2d(x, y)
44
============
5+
Make a 2D histogram plot.
56
67
See `~matplotlib.axes.Axes.hist2d`.
78
"""

galleries/plot_types/stats/hist_plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=======
33
hist(x)
44
=======
5+
Compute and plot a histogram.
56
67
See `~matplotlib.axes.Axes.hist`.
78
"""

galleries/plot_types/stats/pie.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
======
33
pie(x)
44
======
5+
Plot a pie chart.
56
67
See `~matplotlib.axes.Axes.pie`.
78
"""

galleries/plot_types/stats/violin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=============
33
violinplot(D)
44
=============
5+
Make a violin plot.
56
67
See `~matplotlib.axes.Axes.violinplot`.
78
"""

galleries/plot_types/unstructured/tricontour.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
===================
33
tricontour(x, y, z)
44
===================
5+
Draw contour lines on an unstructured triangular grid.
56
67
See `~matplotlib.axes.Axes.tricontour`.
78
"""

galleries/plot_types/unstructured/tricontourf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
====================
33
tricontourf(x, y, z)
44
====================
5+
Draw contour regions on an unstructured triangular grid.
56
67
See `~matplotlib.axes.Axes.tricontourf`.
78
"""

galleries/plot_types/unstructured/tripcolor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
==================
33
tripcolor(x, y, z)
44
==================
5+
Create a pseudocolor plot of an unstructured triangular grid.
56
67
See `~matplotlib.axes.Axes.tripcolor`.
78
"""

galleries/plot_types/unstructured/triplot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
=============
33
triplot(x, y)
44
=============
5+
Draw an unstructured triangular grid as lines and/or markers.
56
67
See `~matplotlib.axes.Axes.triplot`.
78
"""

lib/matplotlib/quiver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def _h_arrows(self, length):
727727

728728

729729
_barbs_doc = r"""
730-
Plot a 2D field of barbs.
730+
Plot a 2D field of wind barbs.
731731
732732
Call signature::
733733

lib/matplotlib/stackplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def stackplot(axes, x, *args,
1919
labels=(), colors=None, hatch=None, baseline='zero',
2020
**kwargs):
2121
"""
22-
Draw a stacked area plot.
22+
Draw a stacked area plot or a streamgraph.
2323
2424
Parameters
2525
----------

0 commit comments

Comments
 (0)