8000 Fix several minor typos in examples. · matplotlib/matplotlib@96e6e50 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96e6e50

Browse files
committed
Fix several minor typos in examples.
1 parent 21c16a6 commit 96e6e50

39 files changed

+55
-55
lines changed

doc/mpl_toolkits/axes_grid/figures/simple_axisartist1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ax.axis["bottom", "top", "right"].set_visible(False)
1111

1212
# make an new axis along the first axis axis (x-axis) which pass
13-
# throught y=0.
13+
# through y=0.
1414
ax.axis["y=0"] = ax.new_floating_axis(nth_coord=0, value=0,
1515
axis_direction="bottom")
1616
ax.axis["y=0"].toggle(all=True)

doc/mpl_toolkits/axes_grid/figures/simple_axisline2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fig = plt.figure(1, (4,3))
66

7-
# a subplot with two additiona axis, "xzero" and "yzero". "xzero" is
7+
# a subplot with two additional axis, "xzero" and "yzero". "xzero" is
88
# y=0 line, and "yzero" is x=0 line.
99
ax = SubplotZero(fig, 1, 1, 1)
1010
fig.add_subplot(ax)

doc/users/plotting/examples/custom_boxstyle02.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import matplotlib.pyplot as plt
44

55
# we may derive from matplotlib.patches.BoxStyle._Base class.
6-
# You need to overide transmute method in this case.
6+
# You need to override transmute method in this case.
77

88
class MyStyle(BoxStyle._Base):
99
"""

examples/api/date_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
datafile = cbook.get_sample_data('goog.npy')
3232
try:
3333
# Python3 cannot load python2 .npy files with datetime(object) arrays
34-
# unless the encoding is set to bytes. Hovever this option was
34+
# unless the encoding is set to bytes. However this option was
3535
# not added until numpy 1.10 so this example will only work with
3636
# python 2 or with numpy 1.10 and later.
3737
r = np.load(datafile, encoding='bytes').view(np.recarray)

examples/api/font_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Although it is usually not a good idea to explicitly point to a single
88
ttf file for a font instance, you can do so using the
99
font_manager.FontProperties fname argument (for a more flexible
10-
solution, see the font_fmaily_rc.py and fonts_demo.py examples).
10+
solution, see the font_family_rc.py and fonts_demo.py examples).
1111
"""
1212
import sys
1313
import os

examples/api/histogram_path_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
the faster method of using PolyCollections, were implemented before we
99
had proper paths with moveto/lineto, closepoly etc in mpl. Now that
1010
we have them, we can draw collections of regularly shaped objects with
11-
homogeous properties more efficiently with a PathCollection. This
11+
homogeneous properties more efficiently with a PathCollection. This
1212
example makes a histogram -- its more work to set up the vertex arrays
1313
at the outset, but it should be much faster for large numbers of
1414
objects

examples/api/radar_chart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def example_data():
135135
# Pyrolized Organic Carbon (OP)
136136
# 2)Inclusion of gas-phase specie carbon monoxide (CO)
137137
# 3)Inclusion of gas-phase specie ozone (O3).
138-
# 4)Inclusion of both gas-phase speciesis present...
138+
# 4)Inclusion of both gas-phase species is present...
139139
data = [
140140
['Sulfate', 'Nitrate', 'EC', 'OC1', 'OC2', 'OC3', 'OP', 'CO', 'O3'],
141141
('Basecase', [

examples/api/unicode_minus.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
Unicode minus
44
=============
55
6-
You can use the proper typesetting unicode minus (see
7-
http://en.wikipedia.org/wiki/Plus_sign#Plus_sign) or the ASCII hypen
6+
You can use the proper typesetting Unicode minus (see
7+
https://en.wikipedia.org/wiki/Plus_sign#Plus_sign) or the ASCII hyphen
88
for minus, which some people prefer. The matplotlibrc param
99
axes.unicode_minus controls the default behavior.
1010
11-
The default is to use the unicode minus
11+
The default is to use the Unicode minus.
1212
"""
1313
import numpy as np
1414
import matplotlib
@@ -17,5 +17,5 @@
1717
matplotlib.rcParams['axes.unicode_minus'] = False
1818
fig, ax = plt.subplots()
1919
ax.plot(10*np.random.randn(100), 10*np.random.randn(100), 'o')
20-
ax.set_title('Using hypen instead of unicode minus')
20+
ax.set_title('Using hyphen instead of Unicode minus')
2121
plt.show()

examples/axes_grid/demo_curvelinear_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def curvelinear_test2(fig):
113113
# A parasite axes with given transform
114114
ax2 = ParasiteAxesAuxTrans(ax1, tr, "equal")
115115
# note that ax2.transData == tr + ax1.transData
116-
# Anthing you draw in ax2 will match the ticks and grids of ax1.
116+
# Anything you draw in ax2 will match the ticks and grids of ax1.
117117
ax1.parasites.append(ax2)
118118
intp = cbook.simple_linear_interpolation
119119
ax2.plot(intp(np.array([0, 30]), 50),

examples/axes_grid/demo_parasite_axes2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
to plot multiple different values onto one single plot. Notice how in this
66
example, par1 and par2 are both calling twinx meaning both are tied directly to
77
the x-axis. From there, each of those two axis can behave separately from the
8-
each other, meaning they can take on seperate values from themselves as well as
8+
each other, meaning they can take on separate values from themselves as well as
99
the x-axis.
1010
"""
1111
from mpl_toolkits.axes_grid1 import host_subplot

examples/event_handling/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ matplotlib supports event handling with a GUI neutral event model. So
55
you can connect to matplotlib events w/o knowledge of what user
66
interface matplotlib will ultimately be plugged in to. This has two
77
advantages: the code you write will be more portable, and matplotlib
8-
events are aware of things like data coordinate space and whih axes
8+
events are aware of things like data coordinate space and which axes
99
the event occurs in so you don't have to mess with low level
1010
transformation details to go from canvas space to data space. Object
1111
picking examples are also included.

examples/event_handling/legend_picking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Enable picking on the legend to toggle the legended line on and off
2+
Enable picking on the legend to toggle the original line on and off
33
"""
44
import numpy as np
55
import matplotlib.pyplot as plt

examples/event_handling/viewlims.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __call__(self, ax):
1717
# A class that will regenerate a fractal set as we zoom in, so that you
1818
# can actually see the increasing detail. A box in the left panel will show
1919
# the area to which we are zoomed.
20-
class MandlebrotDisplay(object):
20+
class MandelbrotDisplay(object):
2121
def __init__(self, h=500, w=500, niter=50, radius=2., power=2):
2222
self.height = h
2323
self.width = w
@@ -57,7 +57,7 @@ def ax_update(self, ax):
5757
im.set_extent((xstart, xend, ystart, yend))
5858
ax.figure.canvas.draw_idle()
5959

60-
md = MandlebrotDisplay()
60+
md = MandelbrotDisplay()
6161
Z = md(-2., 0.5, -1.25, 1.25)
6262

6363
fig1, (ax1, ax2) = plt.subplots(1, 2)

examples/misc/ftface_props.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""
33
This is a demo script to show you how to use all the properties of an
44
FT2Font object. These describe global font properties. For
5-
individual character metrices, use the Glyp object, as returned by
5+
individual character metrics, use the Glyph object, as returned by
66
load_char
77
"""
88
import matplotlib
@@ -18,7 +18,7 @@
1818
print('Num faces :', font.num_faces) # number of faces in file
1919
print('Num glyphs :', font.num_glyphs) # number of glyphs in the face
2020
print('Family name :', font.family_name) # face family name
21-
print('Syle name :', font.style_name) # face syle name
21+
print('Style name :', font.style_name) # face style name
2222
print('PS name :', font.postscript_name) # the postscript name
2323
print('Num fixed :', font.num_fixed_sizes) # number of embedded bitmap in face
2424

examples/misc/sample_data_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
Grab mpl data from the ~/.matplotlib/sample_data cache if it exists, else
3-
fetch it from github and cache it
3+
fetch it from GitHub and cache it
44
"""
55
from __future__ import print_function
66
import matplotlib.cbook as cbook

examples/misc/svg_filter_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Demonstrate SVG filtering effects which might be used with mpl.
33
4-
Note that the filtering effects are only effective if your svg rederer
4+
Note that the filtering effects are only effective if your svg renderer
55
support it.
66
"""
77

@@ -78,7 +78,7 @@
7878
for l in [l1, l2]:
7979
# pick up the svg element with given id
8080
shadow = xmlid[l.get_label() + "_shadow"]
81-
# apply shdow filter
81+
# apply shadow filter
8282
shadow.set("filter", 'url(#dropshadow)')
8383

8484
fn = "svg_filter_line.svg"

examples/misc/svg_filter_pie.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Demonstrate SVG filtering effects which might be used with mpl.
33
The pie chart drawing code is borrowed from pie_demo.py
44
5-
Note that the filtering effects are only effective if your svg rederer
5+
Note that the filtering effects are only effective if your svg renderer
66
support it.
77
"""
88

@@ -50,12 +50,12 @@
5050

5151

5252
# filter definition for shadow using a gaussian blur
53-
# and lighteneing effect.
54-
# The lightnening filter is copied from http://www.w3.org/TR/SVG/filters.html
53+
# and lightening effect.
54+
# The lightening filter is copied from http://www.w3.org/TR/SVG/filters.html
5555

5656
# I tested it with Inkscape and Firefox3. "Gaussian blur" is supported
57-
# in both, but the lightnening effect only in the inkscape. Also note
58-
# that, inkscape's exporting also may not support it.
57+
# in both, but the lightening effect only in the Inkscape. Also note
58+
# that, Inkscape's exporting also may not support it.
5959

6060
filter_def = """
6161
<defs xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>

examples/pylab_examples/accented_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""
1+
r"""
22
matplotlib supports accented characters via TeX mathtext
33
44
The following accents are provided: \hat, \breve, \grave, \bar,

examples/pylab_examples/centered_ticklabels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
fh = cbook.get_sample_data('aapl.npy.gz')
2323
try:
2424
# Python3 cannot load python2 .npy files with datetime(object) arrays
25-
# unless the encoding is set to bytes. Hovever this option was
25+
# unless the encoding is set to bytes. However this option was
2626
# not added until numpy 1.10 so this example will only work with
2727
# python 2 or with numpy 1.10 and later.
2828
r = np.load(fh, encoding='bytes')

examples/pylab_examples/demo_agg_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def drop_shadow_line(ax):
265265

266266

267267
def drop_shadow_patches(ax):
268-
# copyed from barchart_demo.py
268+
# Copied from barchart_demo.py
269269
N = 5
270270
menMeans = (20, 35, 30, 35, 27)
271271

examples/pylab_examples/errorbar_subsample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
ax.set_title('only every 5th errorbar')
2626

2727

28-
fig.suptitle('Errorbar subsampling for better visualibility')
28+
fig.suptitle('Errorbar subsampling for better appearance')
2929

3030
plt.show()

examples/pylab_examples/leftventricle_bulleye.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def bullseye_plot(ax, data, segBold=None, cmap=None, norm=None):
6262
theta_i = i*60*np.pi/180
6363
ax.plot([theta_i, theta_i], [r[1], 1], '-k', lw=linewidth)
6464

65-
# Create the bounds for the segmentss 13-16
65+
# Create the bounds for the segments 13-16
6666
for i in range(4):
6767
theta_i = i*90*np.pi/180 - 45*np.pi/180
6868
ax.plot([theta_i, theta_i], [r[0], r[1]], '-k', lw=linewidth)

examples/pylab_examples/pythonic_matplotlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
show commands. These hide a lot of complexity from you that you don't
99
need to see in normal figure creation, like instantiating DPI
1010
instances, managing the bounding boxes of the figure elements,
11-
creating and reaslizing GUI windows and embedding figures in them.
11+
creating and realizing GUI windows and embedding figures in them.
1212
1313
1414
If you are an application developer and want to embed matplotlib in
@@ -19,7 +19,7 @@
1919
2020
If you are a web application developer, you may want to use the
2121
example in webapp_demo.py, which shows how to use the backend agg
22-
figure canvase directly, with none of the globals (current figure,
22+
figure canvas directly, with none of the globals (current figure,
2323
current axes) that are present in the pyplot interface. Note that
2424
there is no reason why the pyplot interface won't work for web
2525
application developers, however.

examples/pylab_examples/scatter_demo2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
datafile = cbook.get_sample_data('goog.npy')
1313
try:
1414
# Python3 cannot load python2 .npy files with datetime(object) arrays
15-
# unless the encoding is set to bytes. Hovever this option was
15+
# unless the encoding is set to bytes. However this option was
1616
# not added until numpy 1.10 so this example will only work with
1717
# python 2 or with numpy 1.10 and later
1818
price_data = np.load(datafile, encoding='bytes').view(np.recarray)

examples/pylab_examples/scatter_masked.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
r0 = 0.6
66
x = 0.9*np.random.rand(N)
77
y = 0.9*np.random.rand(N)
8-
area = np.pi*(10 * np.random.rand(N))**2 # 0 to 10 point radiuses
8+
area = np.pi*(10 * np.random.rand(N))**2 # 0 to 10 point radii
99
c = np.sqrt(area)
1010
r = np.sqrt(x*x + y*y)
1111
area1 = np.ma.masked_where(r < r0, area)

examples/pylab_examples/system_monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def get_stats(t):
5555
try:
5656
# make sure that the GUI framework has a chance to run its event loop
5757
# and clear any GUI events. This needs to be in a try/except block
58-
# because the default implemenation of this method is to raise
58+
# because the default implementation of this method is to raise
5959
# NotImplementedError
6060
fig.canvas.flush_events()
6161
except NotImplementedError:

examples/pylab_examples/tricontour_smooth_delaunay.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ def experiment_res(x, y):
113113
plt.title("Filtering a Delaunay mesh\n" +
114114
"(application to high-resolution tricontouring)")
115115

116-
# 1) plot of the refined (computed) data countours:
116+
# 1) plot of the refined (computed) data contours:
117117
plt.tricontour(tri_refi, z_test_refi, levels=levels, cmap=cmap,
118118
linewidths=[2.0, 0.5, 1.0, 0.5])
119-
# 2) plot of the expected (analytical) data countours (dashed):
119+
# 2) plot of the expected (analytical) data contours (dashed):
120120
if plot_expected:
121121
plt.tricontour(tri_refi, z_expected, levels=levels, cmap=cmap,
122122
linestyles='--')

examples/pylab_examples/webapp_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def make_fig():
3636
# make a translucent scatter collection
3737
x = np.random.rand(100)
3838
y = np.random.rand(100)
39-
area = np.pi * (10 * np.random.rand(100)) ** 2 # 0 to 10 point radiuses
39+
area = np.pi * (10 * np.random.rand(100)) ** 2 # 0 to 10 point radii
4040
c = ax.scatter(x, y, area)
4141
c.set_alpha(0.5)
4242

examples/shapes_and_collections/scatter_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
x = np.random.rand(N)
1010
y = np.random.rand(N)
1111
colors = np.random.rand(N)
12-
area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radiuses
12+
area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radii
1313

1414
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
1515
plt.show()

examples/specialty_plots/topographic_hillshading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# If you need topographically accurate vertical exaggeration, or you don't want
2525
# to guess at what *vert_exag* should be, you'll need to specify the cellsize
2626
# of the grid (i.e. the *dx* and *dy* parameters). Otherwise, any *vert_exag*
27-
# value you specify will be realitive to the grid spacing of your input data
27+
# value you specify will be relative to the grid spacing of your input data
2828
# (in other words, *dx* and *dy* default to 1.0, and *vert_exag* is calculated
2929
# relative to those parameters). Similarly, *dx* and *dy* are assumed to be in
3030
# the same units as your input z-values. Therefore, we'll need to convert the

examples/statistics/histogram_demo_cumulative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
fig, ax = plt.subplots(figsize=(8, 4))
5050

51-
# plot the cumulative histograme
51+
# plot the cumulative histogram
5252
n, bins, patches = ax.hist(x, n_bins, normed=1, histtype='step',
5353
cumulative=True, label='Empirical')
5454

examples/statistics/violinplot_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sample. Rather than showing counts of data points that fall into bins
99
or order statistics, violin plots use kernel density estimation (KDE) to
1010
compute an empirical distribution of the sample. That computation
11-
is controlled by several parameters. This example demostrates how to
11+
is controlled by several parameters. This example demonstrates how to
1212
modify the number of points at which the KDE is evaluated (``points``)
1313
and how to modify the band-width of the KDE (``bw_method``).
1414

examples/units/units_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
plot using a variety of cm vs inches conversions. The example shows
3-
how default unit instrospection works (ax1), how various keywords can
3+
how default unit introspection works (ax1), how various keywords can
44
be used to set the x and y units to override the defaults (ax2, ax3,
55
ax4) and how one can set the xlimits using scalars (ax3, current units
66
assumed) or units (conversions applied to get the numbers to current

examples/user_interfaces/README.wx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ matplotlib in a wxPython application
1616

1717
http://agni.phys.iit.edu/~kmcivor/wxmpl/
1818

19-
Each of these approachs has different benefits and drawbacks, so I
19+
Each of these approaches has different benefits and drawbacks, so I
2020
encourage you to evaluate each of them and select the one that best
2121
meets your needs.

examples/user_interfaces/embedding_in_tk_canvas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def draw_figure(canvas, figure, loc=(0, 0)):
2727
# Position: convert from top-left anchor to center anchor
2828
canvas.create_image(loc[0] + figure_w/2, loc[1] + figure_h/2, image=photo)
2929

30-
# Unfortunatly, there's no accessor for the pointer to the native renderer
30+
# Unfortunately, there's no accessor for the pointer to the native renderer
3131
tkagg.blit(photo, figure_canvas_agg.get_renderer()._renderer, colormode=2)
3232

3333
# Return a handle which contains a reference to the photo object

0 commit comments

Comments
 (0)
0