Skip to content

Commit 3c56987

Browse files
authored
Merge pull request matplotlib#27268 from anntzer/d
Copy-edit various examples.
2 parents 4524fdb + 1abf0a4 commit 3c56987

File tree

14 files changed

+42
-61
lines changed

14 files changed

+42
-61
lines changed

galleries/examples/color/README.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
Color
44
=====
55

6-
For more in-depth information about the colormaps available in matplotlib
7-
as well as a description of their properties,
6+
For a description of the colormaps available in Matplotlib,
87
see the :ref:`colormaps tutorial <tutorials-colors>`.

galleries/examples/color/named_colors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
List of named colors
44
====================
55
6-
This plots a list of the named colors supported in matplotlib.
6+
This plots a list of the named colors supported by Matplotlib.
77
For more information on colors in matplotlib see
88
99
* the :ref:`colors_def` tutorial;

galleries/examples/images_contours_and_fields/image_demo.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
"""
2-
==========
3-
Image demo
4-
==========
5-
6-
Many ways to plot images in Matplotlib.
2+
========================
3+
Many ways to plot images
4+
========================
75
86
The most common way to plot images in Matplotlib is with
97
`~.axes.Axes.imshow`. The following examples demonstrate much of the

galleries/examples/images_contours_and_fields/pcolor_demo.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
"""
2-
===========
3-
Pcolor demo
4-
===========
2+
=============
3+
pcolor images
4+
=============
55
6-
Generating images with `~.axes.Axes.pcolor`.
7-
8-
Pcolor allows you to generate 2D image-style plots. Below we will show how
9-
to do so in Matplotlib.
6+
`~.Axes.pcolor` generates 2D image-style plots, as illustrated below.
107
"""
8+
119
import matplotlib.pyplot as plt
1210
import numpy as np
1311

galleries/examples/text_labels_and_annotations/accented_text.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
r"""
2-
=================================
3-
Using accented text in Matplotlib
4-
=================================
2+
=============
3+
Accented text
4+
=============
55
66
Matplotlib supports accented characters via TeX mathtext or Unicode.
77

galleries/examples/text_labels_and_annotations/annotation_demo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Annotating Plots
44
================
55
6-
The following examples show how it is possible to annotate plots in Matplotlib.
6+
The following examples show ways to annotate plots in Matplotlib.
77
This includes highlighting specific points of interest and using various
88
visual tools to call attention to this point. For a more complete and in-depth
99
description of the annotation and text tools in Matplotlib, see the

galleries/examples/text_labels_and_annotations/font_file.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
r"""
2-
===================================
3-
Using a ttf font file in Matplotlib
4-
===================================
2+
====================
3+
Using ttf font files
4+
====================
55
66
Although it is usually not a good idea to explicitly point to a single ttf file
77
for a font instance, you can do so by passing a `pathlib.Path` instance as the

galleries/examples/text_labels_and_annotations/legend_demo.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
Legend Demo
44
===========
55
6-
Plotting legends in Matplotlib.
7-
86
There are many ways to create and customize legends in Matplotlib. Below
97
we'll show a few examples for how to do so.
108

galleries/users_explain/axes/constrainedlayout_guide.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@
4040
4141
.. warning::
4242
43-
Calling ``plt.tight_layout()`` will turn off *constrained layout*!
43+
Calling `~.pyplot.tight_layout` will turn off *constrained layout*!
4444
4545
Simple example
4646
==============
4747
48-
In Matplotlib, the location of Axes (including subplots) are specified in
49-
normalized figure coordinates. It can happen that your axis labels or titles
50-
(or sometimes even ticklabels) go outside the figure area, and are thus
51-
clipped.
48+
With the default Axes positioning, the axes title, axis labels, or tick labels
49+
can sometimes go outside the figure area, and thus get clipped.
5250
"""
5351

5452
# sphinx_gallery_thumbnail_number = 18

galleries/users_explain/axes/legend_guide.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
Legend guide
88
============
99
10-
Generating legends flexibly in Matplotlib.
11-
1210
.. currentmodule:: matplotlib.pyplot
1311
14-
This legend guide is an extension of the documentation available at
15-
:func:`~matplotlib.pyplot.legend` - please ensure you are familiar with
16-
contents of that documentation before proceeding with this guide.
12+
This legend guide extends the `~.Axes.legend` docstring -
13+
please read it before proceeding with this guide.
1714
1815
This guide makes use of some common terms, which are documented here for
1916
clarity:
@@ -62,8 +59,8 @@
6259
line_down, = ax.plot([3, 2, 1], label='Line 1')
6360
ax.legend(handles=[line_up, line_down])
6461
65-
In some cases, it is not possible to set the label of the handle, so it is
66-
possible to pass through the list of labels to :func:`legend`::
62+
In the rare case where the labels cannot directly be set on the handles, they
63+
can also be directly passed to :func:`legend`::
6764
6865
fig, ax = plt.subplots()
6966
line_up, = ax.plot([1, 2, 3], label='Line 2')

galleries/users_explain/axes/tight_layout_guide.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@
1717
An alternative to *tight_layout* is :ref:`constrained_layout
1818
<constrainedlayout_guide>`.
1919
20-
21-
Simple Example
20+
Simple example
2221
==============
2322
24-
In matplotlib, the location of axes (including subplots) are specified in
25-
normalized figure coordinates. It can happen that your axis labels or
26-
titles (or sometimes even ticklabels) go outside the figure area, and are thus
27-
clipped.
28-
23+
With the default Axes positioning, the axes title, axis labels, or tick labels
24+
can sometimes go outside the figure area, and thus get clipped.
2925
"""
3026

3127
# sphinx_gallery_thumbnail_number = 7
@@ -190,8 +186,8 @@ def example_plot(ax, fontsize=12):
190186

191187
# %%
192188
# You may provide an optional *rect* parameter, which specifies the bounding
193-
# box that the subplots will be fit inside. The coordinates must be in
194-
# normalized figure coordinates and the default is (0, 0, 1, 1).
189+
# box that the subplots will be fit inside. The coordinates are in
190+
# normalized figure coordinates and default to (0, 0, 1, 1) (the whole figure).
195191

196192
fig = plt.figure()
197193

@@ -245,7 +241,7 @@ def example_plot(ax, fontsize=12):
245241
# Use with AxesGrid1
246242
# ==================
247243
#
248-
# While limited, :mod:`mpl_toolkits.axes_grid1` is also supported.
244+
# Limited support for :mod:`mpl_toolkits.axes_grid1` is provided.
249245

250246
from mpl_toolkits.axes_grid1 import Grid
251247

galleries/users_explain/colors/colormap-manipulation.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,25 @@
33
44
.. _colormap-manipulation:
55
6-
********************************
7-
Creating Colormaps in Matplotlib
8-
********************************
6+
******************
7+
Creating Colormaps
8+
******************
99
1010
Matplotlib has a number of built-in colormaps accessible via
1111
`.matplotlib.colormaps`. There are also external libraries like
1212
palettable_ that have many extra colormaps.
1313
1414
.. _palettable: https://jiffyclub.github.io/palettable/
1515
16-
However, we often want to create or manipulate colormaps in Matplotlib.
16+
However, we may also want to create or manipulate our own colormaps.
1717
This can be done using the class `.ListedColormap` or
1818
`.LinearSegmentedColormap`.
19-
Seen from the outside, both colormap classes map values between 0 and 1 to
20-
a bunch of colors. There are, however, slight differences, some of which are
21-
shown in the following.
19+
Both colormap classes map values between 0 and 1 to colors. There are however
20+
differences, as explained below.
2221
2322
Before manually creating or manipulating colormaps, let us first see how we
2423
can obtain colormaps and their colors from existing colormap classes.
2524
26-
2725
Getting colormaps and accessing their values
2826
============================================
2927
@@ -32,7 +30,6 @@
3230
which returns a colormap object. The length of the list of colors used
3331
internally to define the colormap can be adjusted via `.Colormap.resampled`.
3432
Below we use a modest value of 8 so there are not a lot of values to look at.
35-
3633
"""
3734

3835
import matplotlib.pyplot as plt

galleries/users_explain/colors/colormaps.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
44
.. _colormaps:
55
6-
********************************
7-
Choosing Colormaps in Matplotlib
8-
********************************
6+
******************
7+
Choosing Colormaps
8+
******************
99
1010
Matplotlib has a number of built-in colormaps accessible via
1111
`.matplotlib.colormaps`. There are also external libraries that

galleries/users_explain/text/text_intro.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
.. _text_intro:
66
7-
========================
8-
Text in Matplotlib Plots
9-
========================
7+
==================
8+
Text in Matplotlib
9+
==================
1010
1111
Introduction to plotting and working with text in Matplotlib.
1212

0 commit comments

Comments
 (0)