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

Skip to content

Commit 383de51

Browse files
committed
[Doc] fix more spelling and grammar
1 parent d9a3c2b commit 383de51

File tree

15 files changed

+66
-66
lines changed

15 files changed

+66
-66
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
from numpy import ma
99

1010
import matplotlib as mpl
11-
import matplotlib.category # Register category unit converter as side-effect.
11+
import matplotlib.category # Register category unit converter as side effect.
1212
import matplotlib.cbook as cbook
1313
import matplotlib.collections as mcoll
1414
import matplotlib.colors as mcolors
1515
import matplotlib.contour as mcontour
16-
import matplotlib.dates # noqa # Register date unit converter as side-effect.
16+
import matplotlib.dates # noqa # Register date unit converter as side effect.
1717
import matplotlib.image as mimage
1818
import matplotlib.legend as mlegend
1919
import matplotlib.lines as mlines
@@ -541,7 +541,7 @@ def indicate_inset_zoom(self, inset_ax, **kwargs):
541541
@_docstring.dedent_interpd
542542
def secondary_xaxis(self, location, *, functions=None, **kwargs):
543543
"""
544-
Add a second x-axis to this Axes.
544+
Add a second x-axis to this `~.axes.Axes`.
545545
546546
For example if we want to have a second scale for the data plotted on
547547
the xaxis.
@@ -583,7 +583,7 @@ def invert(x):
583583
@_docstring.dedent_interpd
584584
def secondary_yaxis(self, location, *, functions=None, **kwargs):
585585
"""
586-
Add a second y-axis to this Axes.
586+
Add a second y-axis to this `~.axes.Axes`.
587587
588588
For example if we want to have a second scale for the data plotted on
589589
the yaxis.
@@ -721,8 +721,8 @@ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
721721
Other Parameters
722722
----------------
723723
**kwargs
724-
Valid keyword arguments are `.Line2D` properties, with the
725-
exception of 'transform':
724+
Valid keyword arguments are `.Line2D` properties, except for
725+
'transform':
726726
727727
%(Line2D:kwdoc)s
728728
@@ -789,8 +789,8 @@ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
789789
Other Parameters
790790
----------------
791791
**kwargs
792-
Valid keyword arguments are `.Line2D` properties, with the
793-
exception of 'transform':
792+
Valid keyword arguments are `.Line2D` properties, except for
793+
'transform':
794794
795795
%(Line2D:kwdoc)s
796796
@@ -1491,7 +1491,7 @@ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
14911491
>>> plot(x1, y1, 'g^', x2, y2, 'g-')
14921492
14931493
In this case, any additional keyword argument applies to all
1494-
datasets. Also this syntax cannot be combined with the *data*
1494+
datasets. Also, this syntax cannot be combined with the *data*
14951495
parameter.
14961496
14971497
By default, each line is assigned a different style specified by a
@@ -1753,15 +1753,15 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
17531753
@_docstring.dedent_interpd
17541754
def loglog(self, *args, **kwargs):
17551755
"""
1756-
Make a plot with log scaling on both the x and y axis.
1756+
Make a plot with log scaling on both the x- and y-axis.
17571757
17581758
Call signatures::
17591759
17601760
loglog([x], y, [fmt], data=None, **kwargs)
17611761
loglog([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
17621762
17631763
This is just a thin wrapper around `.plot` which additionally changes
1764-
both the x-axis and the y-axis to log scaling. All of the concepts and
1764+
both the x-axis and the y-axis to log scaling. All the concepts and
17651765
parameters of plot can be used here as well.
17661766
17671767
The additional parameters *base*, *subs* and *nonpositive* control the
@@ -1807,16 +1807,16 @@ def loglog(self, *args, **kwargs):
18071807
@_docstring.dedent_interpd
18081808
def semilogx(self, *args, **kwargs):
18091809
"""
1810-
Make a plot with log scaling on the x axis.
1810+
Make a plot with log scaling on the x-axis.
18111811
18121812
Call signatures::
18131813
18141814
semilogx([x], y, [fmt], data=None, **kwargs)
18151815
semilogx([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
18161816
18171817
This is just a thin wrapper around `.plot` which additionally changes
1818-
the x-axis to log scaling. All of the concepts and parameters of plot
1819-
can be used here as well.
1818+
the x-axis to log scaling. All the concepts and parameters of plot can
1819+
be used here as well.
18201820
18211821
The additional parameters *base*, *subs*, and *nonpositive* control the
18221822
x-axis properties. They are just forwarded to `.Axes.set_xscale`.
@@ -1854,16 +1854,16 @@ def semilogx(self, *args, **kwargs):
18541854
@_docstring.dedent_interpd
18551855
def semilogy(self, *args, **kwargs):
18561856
"""
1857-
Make a plot with log scaling on the y axis.
1857+
Make a plot with log scaling on the y-axis.
18581858
18591859
Call signatures::
18601860
18611861
semilogy([x], y, [fmt], data=None, **kwargs)
18621862
semilogy([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
18631863
18641864
This is just a thin wrapper around `.plot` which additionally changes
1865-
the y-axis to log scaling. All of the concepts and parameters of plot
1866-
can be used here as well.
1865+
the y-axis to log scaling. All the concepts and parameters of plot can
1866+
be used here as well.
18671867
18681868
The additional parameters *base*, *subs*, and *nonpositive* control the
18691869
y-axis properties. They are just forwarded to `.Axes.set_yscale`.
@@ -3121,7 +3121,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
31213121
For example, you can pass in ``wedgeprops = {'linewidth': 3}``
31223122
to set the width of the wedge border lines equal to 3.
31233123
For more details, look at the doc/arguments of the wedge object.
3124-
By default ``clip_on=False``.
3124+
By default, ``clip_on=False``.
31253125
31263126
textprops : dict, default: None
31273127
Dict of arguments to pass to the text objects.
@@ -3352,7 +3352,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33523352
The format for the data points / data lines. See `.plot` for
33533353
details.
33543354
3355-
Use 'none' (case insensitive) to plot errorbars without any data
3355+
Use 'none' (case-insensitive) to plot errorbars without any data
33563356
markers.
33573357
33583358
ecolor : color, default: None
@@ -4387,7 +4387,7 @@ def invalid_shape_exception(csize, xsize):
43874387
c_is_mapped = False
43884388
if c.size != xsize:
43894389
valid_shape = False
4390-
# If c can be either mapped values or a RGB(A) color, prefer
4390+
# If c can be either mapped values or an RGB(A) color, prefer
43914391
# the former if shapes match, the latter otherwise.
43924392
elif c.size == xsize:
43934393
c = c.ravel()
@@ -4458,9 +4458,9 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
44584458
Note that *c* should not be a single numeric RGB or RGBA sequence
44594459
because that is indistinguishable from an array of values to be
44604460
colormapped. If you want to specify the same RGB or RGBA value for
4461-
all points, use a 2D array with a single row. Otherwise, value-
4462-
matching will have precedence in case of a size matching with *x*
4463-
and *y*.
4461+
all points, use a 2D array with a single row. Otherwise,
4462+
value-matching will have precedence in case of a size matching with
4463+
*x* and *y*.
44644464
44654465
If you wish to specify a single color for all points
44664466
prefer the *color* keyword argument.
@@ -5126,7 +5126,7 @@ def _quiver_units(self, args, kwargs):
51265126
return (x, y) + args[2:]
51275127
return args
51285128

5129-
# args can by a combination if X, Y, U, V, C and all should be replaced
5129+
# args can be a combination of X, Y, U, V, C and all should be replaced
51305130
@_preprocess_data()
51315131
@_docstring.dedent_interpd
51325132
def quiver(self, *args, **kwargs):
@@ -6566,7 +6566,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
65666566
equals 1.
65676567
65686568
bottom : array-like, scalar, or None, default: None
6569-
Location of the bottom of each bin, ie. bins are drawn from
6569+
Location of the bottom of each bin, i.e. bins are drawn from
65706570
``bottom`` to ``bottom + hist(x, bins)`` If a scalar, the bottom
65716571
of each bin is shifted by the same amount. If an array, each bin
65726572
is shifted independently and the length of bottom must match the
@@ -7060,9 +7060,9 @@ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
70607060
histogrammed along the first dimension and values in y are
70617061
histogrammed along the second dimension.
70627062
xedges : 1D array
7063-
The bin edges along the x axis.
7063+
The bin edges along the x-axis.
70647064
yedges : 1D array
7065-
The bin edges along the y axis.
7065+
The bin edges along the y-axis.
70667066
image : `~.matplotlib.collections.QuadMesh`
70677067
70687068
Other Parameters
@@ -7653,7 +7653,7 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
76537653
scale : {'default', 'linear', 'dB'}
76547654
The scaling of the values in the *spec*. 'linear' is no scaling.
76557655
'dB' returns the values in dB scale. When *mode* is 'psd',
7656-
this is dB power (10 * log10). Otherwise this is dB amplitude
7656+
this is dB power (10 * log10). Otherwise, this is dB amplitude
76577657
(20 * log10). 'default' is 'dB' if *mode* is 'psd' or
76587658
'magnitude' and 'linear' otherwise. This must be 'linear'
76597659
if *mode* is 'angle' or 'phase'.
@@ -8240,7 +8240,7 @@ def violin(self, vpstats, positions=None, vert=True, widths=0.5,
82408240

82418241
table = mtable.table
82428242

8243-
# args can by either Y or y1, y2, ... and all should be replaced
8243+
# args can be either Y or y1, y2, ... and all should be replaced
82448244
stackplot = _preprocess_data()(mstack.stackplot)
82458245

82468246
streamplot = _preprocess_data(

lib/matplotlib/axes/_base.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class _axis_method_wrapper:
4646
4747
The docstring of ``get_foo`` is built by replacing "this Axis" by "the
4848
{attr_name}" (i.e., "the xaxis", "the yaxis") in the wrapped method's
49-
dedented docstring; additional replacements can by given in *doc_sub*.
49+
dedented docstring; additional replacements can be given in *doc_sub*.
5050
"""
5151

5252
def __init__(self, attr_name, method_name, *, doc_sub=None):
@@ -606,8 +606,8 @@ def __init__(self, fig,
606606
`.SubplotSpec` instance.
607607
608608
sharex, sharey : `~.axes.Axes`, optional
609-
The x or y `~.matplotlib.axis` is shared with the x or
610-
y axis in the input `~.axes.Axes`.
609+
The x- or y-`~.matplotlib.axis` is shared with the x- or y-axis in
610+
the input `~.axes.Axes`.
611611
612612
frameon : bool, default: True
613613
Whether the Axes frame is visible.
@@ -1093,7 +1093,7 @@ def get_position(self, original=False):
10931093
Parameters
10941094
----------
10951095
original : bool
1096-
If ``True``, return the original position. Otherwise return the
1096+
If ``True``, return the original position. Otherwise, return the
10971097
active position. For an explanation of the positions see
10981098
`.set_position`.
10991099
@@ -1422,7 +1422,7 @@ def __init__(self, axes, prop_name, add_name,
14221422
"""
14231423
Parameters
14241424
----------
1425-
axes : .axes.Axes
1425+
axes : `~matplotlib.axes.Axes`
14261426
The Axes from which this sublist will pull the children
14271427
Artists.
14281428
prop_name : str
@@ -1702,7 +1702,7 @@ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
17021702
17031703
anchor : None or str or (float, float), optional
17041704
If not ``None``, this defines where the Axes will be drawn if there
1705-
is extra space due to aspect constraints. The most common way to
1705+
is extra space due to aspect constraints. The most common way
17061706
to specify the anchor are abbreviations of cardinal directions:
17071707
17081708
===== =====================
@@ -2911,10 +2911,10 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True):
29112911
behaves like True).
29122912
29132913
scalex : bool, default: True
2914-
Whether to autoscale the x axis.
2914+
Whether to autoscale the x-axis.
29152915
29162916
scaley : bool, default: True
2917-
Whether to autoscale the y axis.
2917+
Whether to autoscale the y-axis.
29182918
29192919
Notes
29202920
-----
@@ -3997,7 +3997,7 @@ def format_xdata(self, x):
39973997

39983998
def format_ydata(self, y):
39993999
"""
4000-
Return *y* formatted as an y-value.
4000+
Return *y* formatted as a y-value.
40014001
40024002
This function will use the `.fmt_ydata` attribute if it is not None,
40034003
else will fall back on the yaxis major formatter.

lib/matplotlib/backends/backend_agg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def restore_region(self, region, bbox=None, xy=None):
335335

336336
def start_filter(self):
337337
"""
338-
Start filtering. It simply create a new canvas (the old one is saved).
338+
Start filtering. It simply creates a new canvas (the old one is saved).
339339
"""
340340
self._filter_renderers.append(self._renderer)
341341
self._renderer = _RendererAgg(int(self.width), int(self.height),
@@ -344,7 +344,7 @@ def start_filter(self):
344344

345345
def stop_filter(self, post_processing):
346346
"""
347-
Save the plot in the current canvas as a image and apply
347+
Save the plot in the current canvas as an image and apply
348348
the *post_processing* function.
349349
350350
def post_processing(image, dpi):

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2614,7 +2614,7 @@ def clip_cmd(self, cliprect, clippath):
26142614
def delta(self, other):
26152615
"""
26162616
Copy properties of other into self and return PDF commands
2617-
needed to transform self into other.
2617+
needed to transform *self* into *other*.
26182618
"""
26192619
cmds = []
26202620
fill_performed = False

lib/matplotlib/backends/backend_ps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ def _print_figure(
870870
Render the figure to a filesystem path or a file-like object.
871871
872872
Parameters are as for `.print_figure`, except that *dsc_comments* is a
873-
all string containing Document Structuring Convention comments,
873+
string containing Document Structuring Convention comments,
874874
generated from the *metadata* parameter to `.print_figure`.
875875
"""
876876
is_eps = fmt == 'eps'
@@ -1187,7 +1187,7 @@ def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
11871187
# the original bbox can be restored during the pstoeps step.
11881188

11891189
if eps:
1190-
# For some versions of gs, above steps result in an ps file where the
1190+
# For some versions of gs, above steps result in a ps file where the
11911191
# original bbox is no more correct. Do not adjust bbox for now.
11921192
pstoeps(tmpfile, bbox, rotated=rotated)
11931193

lib/matplotlib/backends/backend_qt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ class __getattr__:
103103
def _create_qApp():
104104
app = QtWidgets.QApplication.instance()
105105

106-
# Create a new QApplication and configure if if non exists yet, as only one
107-
# QApplication can exist at a time.
106+
# Create a new QApplication and configure it if none exists yet, as only
107+
# one QApplication can exist at a time.
108108
if app is None:
109109
# display_is_valid returns False only if on Linux and neither X11
110110
# nor Wayland display can be opened.
@@ -376,7 +376,7 @@ def _get_key(self, event):
376376
except KeyError:
377377
# Unicode defines code points up to 0x10ffff (sys.maxunicode)
378378
# QT will use Key_Codes larger than that for keyboard keys that are
379-
# are not Unicode characters (like multimedia keys)
379+
# not Unicode characters (like multimedia keys)
380380
# skip these
381381
# if you really want them, you should add them to SPECIAL_KEYS
382382
if event_key > sys.maxunicode:

lib/matplotlib/backends/backend_template.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
produced. This provides a starting point for backend writers; you can
1111
selectively implement drawing methods (`~.RendererTemplate.draw_path`,
1212
`~.RendererTemplate.draw_image`, etc.) and slowly see your figure come to life
13-
instead having to have a full blown implementation before getting any results.
13+
instead having to have a full-blown implementation before getting any results.
1414
15-
Copy this file to a directory outside of the Matplotlib source tree, somewhere
15+
Copy this file to a directory outside the Matplotlib source tree, somewhere
1616
where Python can import it (by adding the directory to your ``sys.path`` or by
1717
packaging it as a normal Python package); if the backend is importable as
1818
``import my.backend`` you can then select it using ::
@@ -122,7 +122,7 @@ class GraphicsContextTemplate(GraphicsContextBase):
122122
do the mapping here, you'll need to override several of the setter
123123
methods.
124124
125-
The base GraphicsContext stores colors as a RGB tuple on the unit
125+
The base GraphicsContext stores colors as an RGB tuple on the unit
126126
interval, e.g., (0.5, 0.0, 1.0). You may need to map this to colors
127127
appropriate for your backend.
128128
"""

lib/matplotlib/backends/backend_wx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class GraphicsContextWx(GraphicsContextBase):
303303
seems to be fairly heavy, so these objects are cached based on the
304304
bitmap object that is passed in.
305305
306-
The base GraphicsContext stores colors as a RGB tuple on the unit
306+
The base GraphicsContext stores colors as an RGB tuple on the unit
307307
interval, e.g., (0.5, 0.0, 1.0). wxPython uses an int interval, but
308308
since wxPython colour management is rather simple, I have not chosen
309309
to implement a separate colour manager class.
@@ -398,7 +398,7 @@ def set_joinstyle(self, js):
398398
self.unselect()
399399

400400
def get_wxcolour(self, color):
401-
"""Convert a RGB(A) color to a wx.Colour."""
401+
"""Convert an RGB(A) color to a wx.Colour."""
402402
_log.debug("%s - get_wx_color()", type(self))
403403
return wx.Colour(*[int(255 * x) for x in color])
404404

0 commit comments

Comments
 (0)