8000 DOC: Standardize example titles - part 2 · matplotlib/matplotlib@a4e9e07 · GitHub
[go: up one dir, main page]

Skip to content

Commit a4e9e07

Browse files
timhoffmstory645
andcommitted
DOC: Standardize example titles - part 2
Follow up to #28544. As there: Following recommendations from #28527, this improves example titles. Take this as an incremental improvement. I've changed what I saw t a glance when going through the examples once. Certainly, one could do further improvements, but that can be done in follow-ups. Co-authored-by: hannah <story645@gmail.com>
1 parent e0e49ef commit a4e9e07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+172
-170
lines changed

galleries/examples/animation/pause_resume.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=================================
3-
Pausing and resuming an animation
4-
=================================
2+
=============================
3+
Pause and resume an animation
4+
=============================
55
66
This example showcases:
77

galleries/examples/axes_grid1/demo_axes_rgb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==================================
3-
Showing RGB channels using RGBAxes
4-
==================================
2+
===============================
3+
Show RGB channels using RGBAxes
4+
===============================
55
66
`~.axes_grid1.axes_rgb.RGBAxes` creates a layout of 4 Axes for displaying RGB
77
channels: one large Axes for the RGB image and 3 smaller Axes for the R, G, B

galleries/examples/axes_grid1/demo_colorbar_with_inset_locator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
22
.. _demo-colorbar-with-inset-locator:
33
4-
==============================================================
5-
Controlling the position and size of colorbars with Inset Axes
6-
==============================================================
4+
===========================================================
< 6377 /code>
5+
Control the position and size of a colorbar with Inset Axes
6+
===========================================================
77
88
This example shows how to control the position, height, and width of colorbars
99
using `~mpl_toolkits.axes_grid1.inset_locator.inset_axes`.

galleries/examples/axes_grid1/demo_imagegrid_aspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
=========================================
3-
Setting a fixed aspect on ImageGrid cells
3+
ImageGrid cells with a fixed aspect ratio
44
=========================================
55
"""
66

galleries/examples/color/custom_cmap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=========================================
3-
Creating a colormap from a list of colors
4-
=========================================
2+
=======================================
3+
Create a colormap from a list of colors
4+
=======================================
55
66
For more detail on creating and manipulating colormaps see
77
:ref:`colormap-manipulation`.

galleries/examples/images_contours_and_fields/image_annotated_heatmap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===========================
3-
Creating annotated heatmaps
4-
===========================
2+
=================
3+
Annotated heatmap
4+
=================
55
66
It is often desirable to show data which depends on two independent
77
variables as a color coded image plot. This is often referred to as a

galleries/examples/lines_bars_and_markers/bar_colors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==============
3-
Bar color demo
4-
==============
2+
====================================
3+
Bar chart with individual bar colors
4+
====================================
55
66
This is an example showing how to control bar color and legend entries
77
using the *color* and *label* parameters of `~matplotlib.pyplot.bar`.

galleries/examples/lines_bars_and_markers/fill_between_alpha.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==============================
3-
Fill Between with transparency
4-
==============================
2+
==================================
3+
``fill_between`` with transparency
4+
==================================
55
66
The `~matplotlib.axes.Axes.fill_between` function generates a shaded
77
region between a min and max boundary that is useful for illustrating ranges.

galleries/examples/lines_bars_and_markers/fill_between_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==============================
3-
Filling the area between lines
4-
==============================
2+
===============================
3+
Fill the area between two lines
4+
===============================
55
66
This example shows how to use `~.axes.Axes.fill_between` to color the area
77
between two lines.

galleries/examples/lines_bars_and_markers/fill_betweenx_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==================
3-
Fill Betweenx Demo
4-
==================
2+
========================================
3+
Fill the area between two vertical lines
4+
========================================
55
66
Using `~.Axes.fill_betweenx` to color along the horizontal direction between
77
two curves.

galleries/examples/lines_bars_and_markers/line_demo_dash_control.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==============================
3-
Customizing dashed line styles
4-
==============================
2+
===============================
3+
Dashed line style configuration
4+
===============================
55
66
The dashing of a line is controlled via a dash sequence. It can be modified
77
using `.Line2D.set_dashes`.

galleries/examples/lines_bars_and_markers/scatter_masked.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==========================
3-
Scatter with masked values
4-
==========================
2+
===============================
3+
Scatter plot with masked values
4+
===============================
55
66
Mask some data points and add a line demarking
77
masked regions.

galleries/examples/lines_bars_and_markers/scatter_with_legend.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===========================
3-
Scatter plots with a legend
4-
===========================
2+
==========================
3+
Scatter plot with a legend
4+
==========================
55
66
To create a scatter plot with a legend one may use a loop and create one
77
`~.Axes.scatter` plot per item to appear in the legend and set the ``label``

galleries/examples/lines_bars_and_markers/timeline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===============================================
3-
Creating a timeline with lines, dates, and text
4-
===============================================
2+
====================================
3+
Timeline with lines, dates, and text
4+
====================================
55
66
How to create a simple timeline using Matplotlib release dates.
77

galleries/examples/misc/bbox_intersect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===========================================
3-
Changing colors of lines intersecting a box
4-
===========================================
2+
==================================
3+
Identify whether artists intersect
4+
==================================
55
66
The lines intersecting the rectangle are colored in red, while the others
77
are left as blue lines. This example showcases the `.intersects_bbox` function.

galleries/examples/misc/demo_ribbon_box.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
==========
3-
Ribbon Box
3+
Ribbon box
44
==========
55
66
"""

galleries/examples/misc/fig_x.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
2-
=======================
3-
Adding lines to figures
4-
=======================
2+
==============================
3+
Add lines directly to a figure
4+
==============================
55
6-
Adding lines to a figure without any Axes.
6+
You can add artists such as a `.Line2D` directly to a figure. This is
7+
typically useful for visual structuring.
78
89
.. redirect-from:: /gallery/pyplots/fig_x
910
"""
@@ -12,9 +13,9 @@
1213

1314
import matplotlib.lines as lines
1415

15-
fig = plt.figure()
16-
fig.add_artist(lines.Line2D([0, 1], [0, 1]))
17-
fig.add_artist(lines.Line2D([0, 1], [1, 0]))
16+
fig, axs = plt.subplots(2, 2, gridspec_kw={'hspace': 0.4, 'wspace': 0.4})
17+
fig.add_artist(lines.Line2D([0, 1], [0.47, 0.47], linewidth=3))
18+
fig.add_artist(lines.Line2D([0.5, 0.5], [1, 0], linewidth=3))
1819
plt.show()
1920

2021
# %%

galleries/examples/misc/fill_spiral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
===========
3-
Fill Spiral
3+
Fill spiral
44
===========
55
66
"""

galleries/examples/pie_and_polar_charts/pie_and_donut_labels.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==========================
3-
Labeling a pie and a donut
4-
==========================
2+
=============================
3+
A pie and a donut with labels
4+
=============================
55
66
Welcome to the Matplotlib bakery. We will create a pie and a donut
77
chart through the `pie method <matplotlib.axes.Axes.pie>` and

galleries/examples/shapes_and_collections/line_collection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=============================================
3-
Plotting multiple lines with a LineCollection
4-
=============================================
2+
==========================================
3+
Plot multiple lines using a LineCollection
4+
==========================================
55
66
Matplotlib can efficiently draw multiple lines at once using a `~.LineCollection`.
77
"""

galleries/examples/statistics/errorbars_and_boxes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
====================================================
3-
Creating boxes from error bars using PatchCollection
4-
====================================================
2+
==================================================
3+
Create boxes from error bars using PatchCollection
4+
==================================================
55
66
In this example, we snazz up a pretty standard error bar plot by adding
77
a rectangle patch defined by the limits of the bars in both the x- and

galleries/examples/statistics/histogram_cumulative.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=================================
3-
Plotting cumulative distributions
4-
=================================
2+
========================
3+
Cumulative distributions
4+
========================
55
66
This example shows how to plot the empirical cumulative distribution function
77
(ECDF) of a sample. We also show the theoretical CDF.

galleries/examples/statistics/multiple_histograms_side_by_side.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==========================================
3-
Producing multiple histograms side by side
4-
==========================================
2+
================================
3+
Multiple histograms side by side
4+
================================
55
66
This example plots horizontal histograms of different samples along
77
a categorical x-axis. Additionally, the histograms are plotted to

galleries/examples/subplots_axes_and_figures/auto_subplots_adjust.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===============================================
3-
Programmatically controlling subplot adjustment
4-
===============================================
2+
===========================================
3+
Programmatically control subplot adjustment
4+
===========================================
55
66
.. note::
77

galleries/examples/subplots_axes_and_figures/axhspan_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=================================
3-
Drawing regions that span an Axes
4-
=================================
2+
==============================
3+
Draw regions that span an Axes
4+
==============================
55
66
`~.Axes.axhspan` and `~.Axes.axvspan` draw rectangles that span the Axes in either
77
the horizontal or vertical direction and are bounded in the other direction. They are

galleries/examples/subplots_axes_and_figures/demo_constrained_layout.py

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=====================================
3-
Resizing Axes with constrained layout
4-
=====================================
2+
===================================
3+
Resize Axes with constrained layout
4+
===================================
55
66
*Constrained layout* attempts to resize subplots in
77
a figure so that there are no overlaps between Axes objects and labels
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===============================
3-
Resizing Axes with tight layout
4-
===============================
2+
=============================
3+
Resize Axes with tight layout
4+
=============================
55
66
`~.Figure.tight_layout` attempts to resize subplots in a figure so that there
77
are no overlaps between Axes objects and labels on the Axes.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==========================
3-
Creating adjacent subplots
4-
==========================
2+
=================
3+
Adjacent subplots
4+
=================
55
66
To create plots that share a common axis (visually) you can set the hspace
77
between the subplots to zero. Passing sharex=True when creating the subplots
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==================================================
3-
Combining two subplots using subplots and GridSpec
4-
==================================================
2+
================================================
3+
Combine two subplots using subplots and GridSpec
4+
================================================
55
66
Sometimes we want to combine two subplots in an Axes layout created with
77
`~.Figure.subplots`. We can get the `~.gridspec.GridSpec` from the Axes
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=======================================================
3-
Using Gridspec to make multi-column/row subplot layouts
4-
=======================================================
2+
=============================================
3+
Gridspec for multi-column/row subplot layouts
4+
=============================================
55
66
`.GridSpec` is a flexible way to layout
77
subplot grids. Here is an example with a 3x3 grid, and
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===================================
3-
Managing multiple figures in pyplot
4-
===================================
2+
=================================
3+
Manage multiple figures in pyplot
4+
=================================
55
66
`matplotlib.pyplot` uses the concept of a *current figure* and *current Axes*.
77
Figures are identified via a figure number that is passed to `~.pyplot.figure`.
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
2-
Sharing axis limits and views
3-
=============================
2+
===========================
3+
Share axis limits and views
4+
===========================
45
56
It's common to make two or more plots which share an axis, e.g., two subplots
67
with time as a common axis. When you pan and zoom around on one, you want the
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=================================================
3-
Creating multiple subplots using ``plt.subplots``
4-
=================================================
2+
===============================================
3+
Create multiple subplots using ``plt.subplots``
4+
===============================================
55
66
`.pyplot.subplots` creates a figure and a grid of subplots with a single call,
77
while providing reasonable control over how the individual plots are created.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
==================
3-
Auto-wrapping text
4-
==================
2+
==============
3+
Auto-wrap text
4+
==============
55
6-
Matplotlib can wrap text automatically, but if it's too long, the text will be
7-
displayed slightly outside of the boundaries of the axis anyways.
6+
Matplotlib can wrap text automatically, but if it's too long, the text will
7+
still be displayed slightly outside the boundaries of the axis.
88
99
Note: Auto-wrapping does not work together with
1010
``savefig(..., bbox_inches='tight')``. The 'tight' setting rescales the canvas
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=========================================
3-
Labeling ticks using engineering notation
4-
=========================================
2+
=======================================
3+
Format ticks using engineering notation
4+
=======================================
55
66
Use of the engineering Formatter.
77
"""

0