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
"""

0 commit comments

Comments
 (0)