Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f4c02d

Browse files
authored
Merge pull request #24525 from oscargus/examplespelling
[Doc] Fix spelling and grammar in examples
2 parents 7879ae8 + e4e140b commit 2f4c02d

File tree

66 files changed

+139
-141
lines changed

Some content is hidden

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

66 files changed

+139
-141
lines changed

examples/axes_grid1/demo_axes_divider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
============
3-
Axes Divider
3+
Axes divider
44
============
55
66
Axes divider to calculate location of axes and
@@ -112,7 +112,7 @@ def demo():
112112

113113
# PLOT 3
114114
# image and colorbar whose location is adjusted in the drawing time.
115-
# a easy way
115+
# an easy way
116116

117117
ax = fig.add_subplot(2, 2, 3)
118118
demo_locatable_axes_easy(ax)

examples/axes_grid1/inset_locator_demo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
==================
3-
Inset Locator Demo
3+
Inset locator demo
44
==================
55
66
"""
@@ -45,7 +45,7 @@
4545

4646
###############################################################################
4747
# The parameters *bbox_to_anchor* and *bbox_transform* can be used for a more
48-
# fine grained control over the inset position and size or even to position
48+
# fine-grained control over the inset position and size or even to position
4949
# the inset at completely arbitrary positions.
5050
# The *bbox_to_anchor* sets the bounding box in coordinates according to the
5151
# *bbox_transform*.
@@ -54,12 +54,12 @@
5454
fig = plt.figure(figsize=[5.5, 2.8])
5555
ax = fig.add_subplot(121)
5656

57-
# We use the axes transform as bbox_transform. Therefore the bounding box
57+
# We use the axes transform as bbox_transform. Therefore, the bounding box
5858
# needs to be specified in axes coordinates ((0, 0) is the lower left corner
5959
# of the axes, (1, 1) is the upper right corner).
6060
# The bounding box (.2, .4, .6, .5) starts at (.2, .4) and ranges to (.8, .9)
6161
# in those coordinates.
62-
# Inside of this bounding box an inset of half the bounding box' width and
62+
# Inside this bounding box an inset of half the bounding box' width and
6363
# three quarters of the bounding box' height is created. The lower left corner
6464
# of the inset is aligned to the lower left corner of the bounding box (loc=3).
6565
# The inset is then offset by the default 0.5 in units of the font size.
@@ -103,7 +103,7 @@
103103
###############################################################################
104104
# In the above the axes transform together with 4-tuple bounding boxes has been
105105
# used as it mostly is useful to specify an inset relative to the axes it is
106-
# an inset to. However other use cases are equally possible. The following
106+
# an inset to. However, other use cases are equally possible. The following
107107
# example examines some of those.
108108
#
109109

examples/axes_grid1/inset_locator_demo2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
22
====================
3-
Inset Locator Demo 2
3+
Inset locator demo 2
44
====================
55
6-
This Demo shows how to create a zoomed inset via `.zoomed_inset_axes`.
6+
This demo shows how to create a zoomed inset via `.zoomed_inset_axes`.
77
In the first subplot an `.AnchoredSizeBar` shows the zoom effect.
88
In the second subplot a connection to the region of interest is
99
created via `.mark_inset`.
@@ -63,7 +63,7 @@ def add_sizebar(ax, size):
6363
axins2 = zoomed_inset_axes(ax2, zoom=6, loc=1)
6464
axins2.imshow(Z2, extent=extent, origin="lower")
6565

66-
# sub region of the original image
66+
# subregion of the original image
6767
x1, x2, y1, y2 = -1.5, -0.9, -2.5, -1.9
6868
axins2.set_xlim(x1, x2)
6969
axins2.set_ylim(y1, y2)

examples/axes_grid1/simple_axes_divider3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
=====================
3-
Simple Axes Divider 3
3+
Simple axes divider 3
44
=====================
55
66
See also :doc:`/tutorials/toolkits/axes_grid`.
@@ -13,7 +13,7 @@
1313

1414
fig = plt.figure(figsize=(5.5, 4))
1515

16-
# the rect parameter will be ignore as we will set axes_locator
16+
# the rect parameter will be ignored as we will set axes_locator
1717
rect = (0.1, 0.1, 0.8, 0.8)
1818
ax = [fig.add_axes(rect, label="%d" % i) for i in range(4)]
1919

examples/event_handling/cursor_demo.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""
22
=================
3-
Cross hair cursor
3+
Cross-hair cursor
44
=================
55
6-
This example adds a cross hair as a data cursor. The cross hair is
6+
This example adds a cross-hair as a data cursor. The cross-hair is
77
implemented as regular line objects that are updated on mouse move.
88
99
We show three implementations:
1010
1111
1) A simple cursor implementation that redraws the figure on every mouse move.
12-
This is a bit slow and you may notice some lag of the cross hair movement.
12+
This is a bit slow, and you may notice some lag of the cross-hair movement.
1313
2) A cursor that uses blitting for speedup of the rendering.
1414
3) A cursor that snaps to data points.
1515
@@ -76,18 +76,18 @@ def on_mouse_move(self, event):
7676
# Faster redrawing using blitting
7777
# """""""""""""""""""""""""""""""
7878
# This technique stores the rendered plot as a background image. Only the
79-
# changed artists (cross hair lines and text) are rendered anew. They are
79+
# changed artists (cross-hair lines and text) are rendered anew. They are
8080
# combined with the background using blitting.
8181
#
8282
# This technique is significantly faster. It requires a bit more setup because
83-
# the background has to be stored without the cross hair lines (see
83+
# the background has to be stored without the cross-hair lines (see
8484
# ``create_new_background()``). Additionally, a new background has to be
8585
# created whenever the figure changes. This is achieved by connecting to the
8686
# ``'draw_event'``.
8787

8888
class BlittedCursor:
8989
"""
90-
A cross hair cursor using blitting for faster redraw.
90+
A cross-hair cursor using blitting for faster redraw.
9191
"""
9292
def __init__(self, ax):
9393
self.ax = ax
@@ -167,7 +167,7 @@ def on_mouse_move(self, event):
167167

168168
class SnappingCursor:
169169
"""
170-
A cross hair cursor that snaps to the data point of a line, which is
170+
A cross-hair cursor that snaps to the data point of a line, which is
171171
closest to the *x* position of the cursor.
172172
173173
For simplicity, this assumes that *x* values of the data are sorted.

examples/event_handling/data_browser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
22
============
3-
Data Browser
3+
Data browser
44
============
55
66
Connecting data between multiple canvases.
77
88
This example covers how to interact data with multiple canvases. This
9-
let's you select and highlight a point on one axis, and generating the
9+
lets you select and highlight a point on one axis, and generating the
1010
data of that point on the other axis.
1111
1212
.. note::

examples/event_handling/legend_picking.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
==============
3-
Legend Picking
3+
Legend picking
44
==============
55
66
Enable picking on the legend to toggle the original line on and off
@@ -42,7 +42,7 @@ def on_pick(event):
4242
origline = lined[legline]
4343
visible = not origline.get_visible()
4444
origline.set_visible(visible)
45-
# Change the alpha on the line in the legend so we can see what lines
45+
# Change the alpha on the line in the legend, so we can see what lines
4646
# have been toggled.
4747
legline.set_alpha(1.0 if visible else 0.2)
4848
fig.canvas.draw()

examples/event_handling/path_editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
===========
3-
Path Editor
3+
Path editor
44
===========
55
66
Sharing events across GUIs.
@@ -47,7 +47,7 @@
4747

4848
class PathInteractor:
4949
"""
50-
An path editor.
50+
A path editor.
5151
5252
Press 't' to toggle vertex markers on and off. When vertex markers are on,
5353
they can be dragged with the mouse.

examples/event_handling/pick_event_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
===============
3-
Pick Event Demo
3+
Pick event demo
44
===============
55
66
You can enable picking by setting the "picker" property of an artist
@@ -56,7 +56,7 @@ def pick_handler(event):
5656
the matplotlib.artist that generated the pick event.
5757
5858
Additionally, certain artists like Line2D and PatchCollection may
59-
attach additional meta data like the indices into the data that meet
59+
attach additional metadata like the indices into the data that meet
6060
the picker criteria (for example, all the points in the line that are within
6161
the specified epsilon tolerance)
6262

examples/event_handling/pick_event_demo2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
================
3-
Pick Event Demo2
4-
================
2+
=================
3+
Pick event demo 2
4+
=================
55
66
Compute the mean (mu) and standard deviation (sigma) of 100 data sets and plot
77
mu vs. sigma. When you click on one of the (mu, sigma) points, plot the raw

examples/images_contours_and_fields/colormap_normalizations.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
=======================
3-
Colormap Normalizations
3+
Colormap normalizations
44
=======================
55
66
Demonstration of using norm to map colormaps onto data in non-linear ways.
@@ -20,8 +20,8 @@
2020
X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)]
2121

2222
# A low hump with a spike coming out of the top. Needs to have
23-
# z/colour axis on a log scale so we see both hump and spike. linear
24-
# scale only shows the spike.
23+
# z/colour axis on a log scale, so we see both hump and spike.
24+
# A linear scale only shows the spike.
2525

2626
Z1 = np.exp(-X**2 - Y**2)
2727
Z2 = np.exp(-(X * 10)**2 - (Y * 10)**2)
@@ -63,19 +63,17 @@
6363
# Note that colorbar labels do not come out looking very good.
6464

6565
X, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)]
66-
Z1 = 5 * np.exp(-X**2 - Y**2)
67-
Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2)
68-
Z = (Z1 - Z2) * 2
66+
Z = 5 * np.exp(-X**2 - Y**2)
6967

7068
fig, ax = plt.subplots(2, 1)
7169

72-
pcm = ax[0].pcolormesh(X, Y, Z1,
70+
pcm = ax[0].pcolormesh(X, Y, Z,
7371
norm=colors.SymLogNorm(linthresh=0.03, linscale=0.03,
7472
vmin=-1.0, vmax=1.0, base=10),
7573
cmap='RdBu_r', shading='nearest')
7674
fig.colorbar(pcm, ax=ax[0], extend='both')
7775

78-
pcm = ax[1].pcolormesh(X, Y, Z1, cmap='RdBu_r', vmin=-np.max(Z1),
76+
pcm = ax[1].pcolormesh(X, Y, Z, cmap='RdBu_r', vmin=-np.max(Z),
7977
shading='nearest')
8078
fig.colorbar(pcm, ax=ax[1], extend='both')
8179

examples/images_contours_and_fields/colormap_normalizations_symlognorm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
==================================
3-
Colormap Normalizations SymLogNorm
3+
Colormap normalizations SymLogNorm
44
==================================
55
66
Demonstration of using norm to map colormaps onto data in non-linear ways.

examples/images_contours_and_fields/contourf_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
=============
3-
Contourf Demo
3+
Contourf demo
44
=============
55
66
How to use the `.axes.Axes.contourf` method to create filled contour plots.
@@ -97,7 +97,7 @@
9797
cmap = plt.colormaps["winter"].with_extremes(under="magenta", over="yellow")
9898
# Note: contouring simply excludes masked or nan regions, so
9999
# instead of using the "bad" colormap value for them, it draws
100-
# nothing at all in them. Therefore the following would have
100+
# nothing at all in them. Therefore, the following would have
101101
# no effect:
102102
# cmap.set_bad("red")
103103

examples/images_contours_and_fields/contourf_log.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
X, Y = np.meshgrid(x, y)
1919

2020
# A low hump with a spike coming out.
21-
# Needs to have z/colour axis on a log scale so we see both hump and spike.
22-
# linear scale only shows the spike.
21+
# Needs to have z/colour axis on a log scale, so we see both hump and spike.
22+
# A linear scale only shows the spike.
2323
Z1 = np.exp(-X**2 - Y**2)
2424
Z2 = np.exp(-(X * 10)**2 - (Y * 10)**2)
2525
z = Z1 + 50 * Z2

examples/images_contours_and_fields/image_annotated_heatmap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# tick labels (`~matplotlib.axes.Axes.set_xticklabels`),
3434
# otherwise they would become out of sync. The locations are just
3535
# the ascending integer numbers, while the ticklabels are the labels to show.
36-
# Finally we can label the data itself by creating a `~matplotlib.text.Text`
36+
# Finally, we can label the data itself by creating a `~matplotlib.text.Text`
3737
# within each cell showing the value of that cell.
3838

3939

examples/images_contours_and_fields/image_antialiasing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
When subsampling data, aliasing is reduced by smoothing first and then
1313
subsampling the smoothed data. In Matplotlib, we can do that
1414
smoothing before mapping the data to colors, or we can do the smoothing
15-
on the RGB(A) data in the final image. The difference between these is
15+
on the RGB(A) data in the final image. The differences between these are
1616
shown below, and controlled with the *interpolation_stage* keyword argument.
1717
1818
The default image interpolation in Matplotlib is 'antialiased', and
@@ -49,9 +49,9 @@
4949
###############################################################################
5050
# The following images are subsampled from 450 data pixels to either
5151
# 125 pixels or 250 pixels (depending on your display).
52-
# The Moire patterns in the 'nearest' interpolation are caused by the
52+
# The Moiré patterns in the 'nearest' interpolation are caused by the
5353
# high-frequency data being subsampled. The 'antialiased' imaged
54-
# still has some Moire patterns as well, but they are greatly reduced.
54+
# still has some Moiré patterns as well, but they are greatly reduced.
5555
#
5656
# There are substantial differences between the 'data' interpolation and
5757
# the 'rgba' interpolation. The alternating bands of red and blue on the
@@ -81,7 +81,7 @@
8181
plt.show()
8282

8383
###############################################################################
84-
# Even up-sampling an image with 'nearest' interpolation will lead to Moire
84+
# Even up-sampling an image with 'nearest' interpolation will lead to Moiré
8585
# patterns when the upsampling factor is not integer. The following image
8686
# upsamples 500 data pixels to 530 rendered pixels. You may note a grid of
8787
# 30 line-like artifacts which stem from the 524 - 500 = 24 extra pixels that

examples/images_contours_and_fields/image_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
==========
3-
Image Demo
3+
Image demo
44
==========
55
66
Many ways to plot images in Matplotlib.

examples/images_contours_and_fields/image_nonuniform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
22
================
3-
Image Nonuniform
3+
Image nonuniform
44
================
55
66
This illustrates the NonUniformImage class. It is not
7-
available via an Axes method but it is easily added to an
7+
available via an Axes method, but it is easily added to an
88
Axes instance as shown here.
99
"""
1010

examples/images_contours_and_fields/matshow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
=======
3-
Matshow
4-
=======
2+
===============================
3+
Visualize matrices with matshow
4+
===============================
55
66
`~.axes.Axes.matshow` visualizes a 2D matrix or array as color-coded image.
77
"""

examples/images_contours_and_fields/multi_image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
===========
3-
Multi Image
4-
===========
2+
===============
3+
Multiple images
4+
===============
55
66
Make a set of images with a single colormap, norm, and colorbar.
77
"""

0 commit comments

Comments
 (0)