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

Skip to content

Commit e7435d4

Browse files
authored
Merge pull request #24517 from oscargus/spelling
DOC: improve grammar and consistency
2 parents 671703a + 9b6abd0 commit e7435d4

14 files changed

+109
-107
lines changed

lib/matplotlib/artist.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def remove(self):
204204
Note: there is no support for removing the artist's legend entry.
205205
"""
206206

207-
# There is no method to set the callback. Instead the parent should
207+
# There is no method to set the callback. Instead, the parent should
208208
# set the _remove_method attribute directly. This would be a
209209
# protected attribute if Python supported that sort of thing. The
210210
# callback has one parameter, which is the child to be removed.
@@ -521,7 +521,7 @@ def pick(self, mouseevent):
521521
# tick label) can be outside the bounding box of the
522522
# Axes and inaxes will be None
523523
# also check that ax is None so that it traverse objects
524-
# which do no have an axes property but children might
524+
# which do not have an axes property but children might
525525
a.pick(mouseevent)
526526

527527
def set_picker(self, picker):
@@ -878,7 +878,7 @@ def set_clip_on(self, b):
878878
"""
879879
Set whether the artist uses clipping.
880880
881-
When False artists will be visible outside of the Axes which
881+
When False, artists will be visible outside the Axes which
882882
can lead to unexpected results.
883883
884884
Parameters
@@ -1145,7 +1145,7 @@ def _update_props(self, props, errfmt):
11451145
Helper for `.Artist.set` and `.Artist.update`.
11461146
11471147
*errfmt* is used to generate error messages for invalid property
1148-
names; it get formatted with ``type(self)`` and the property name.
1148+
names; it gets formatted with ``type(self)`` and the property name.
11491149
"""
11501150
ret = []
11511151
with cbook._setattr_cm(self, eventson=False):
@@ -1371,7 +1371,7 @@ def set_mouseover(self, mouseover):
13711371
def _get_tightbbox_for_layout_only(obj, *args, **kwargs):
13721372
"""
13731373
Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
1374-
*for_layout_only* kwarg; this helper tries to uses the kwarg but skips it
1374+
*for_layout_only* kwarg; this helper tries to use the kwarg but skips it
13751375
when encountering third-party subclasses that do not support it.
13761376
"""
13771377
try:
@@ -1463,7 +1463,7 @@ def get_valid_values(self, attr):
14631463
# although barely relevant wrt. matplotlib's total import time.
14641464
param_name = func.__code__.co_varnames[1]
14651465
# We could set the presence * based on whether the parameter is a
1466-
# varargs (it can't be a varkwargs) but it's not really worth the it.
1466+
# varargs (it can't be a varkwargs) but it's not really worth it.
14671467
match = re.search(r"(?m)^ *\*?{} : (.+)".format(param_name), docstring)
14681468
if match:
14691469
return match.group(1)
@@ -1523,7 +1523,7 @@ def aliased_name(self, s):
15231523
"""
15241524
Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME'.
15251525
1526-
e.g., for the line markerfacecolor property, which has an
1526+
For example, for the line markerfacecolor property, which has an
15271527
alias, return 'markerfacecolor or mfc' and for the transform
15281528
property, which does not, return 'transform'.
15291529
"""
@@ -1551,7 +1551,7 @@ def aliased_name_rest(self, s, target):
15511551
Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME',
15521552
formatted for reST.
15531553
1554-
e.g., for the line markerfacecolor property, which has an
1554+
For example, for the line markerfacecolor property, which has an
15551555
alias, return 'markerfacecolor or mfc' and for the transform
15561556
property, which does not, return 'transform'.
15571557
"""

lib/matplotlib/axis.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Classes for the ticks and x and y axis.
2+
Classes for the ticks and x- and y-axis.
33
"""
44

55
import datetime
@@ -278,13 +278,13 @@ def _get_text2(self):
278278
"""Get the default Text 2 instance."""
279279

280280
def _get_tick1line(self):
281-
"""Get the default line2D instance for tick1."""
281+
"""Get the default `.Line2D` instance for tick1."""
282282

283283
def _get_tick2line(self):
284-
"""Get the default line2D instance for tick2."""
284+
"""Get the default `.Line2D` instance for tick2."""
285285

286286
def _get_gridline(self):
287-
"""Get the default grid Line2d instance for this tick."""
287+
"""Get the default grid `.Line2D` instance for this tick."""
288288

289289
def get_loc(self):
290290
"""Return the tick location (data coords) as a scalar."""
@@ -796,7 +796,7 @@ def _set_axes_scale(self, value, **kwargs):
796796
797797
Notes
798798
-----
799-
By default, Matplotlib supports the above mentioned scales.
799+
By default, Matplotlib supports the above-mentioned scales.
800800
Additionally, custom scales may be registered using
801801
`matplotlib.scale.register_scale`. These scales can then also
802802
be used here.
@@ -1591,7 +1591,7 @@ def grid(self, visible=None, which='major', **kwargs):
15911591
def update_units(self, data):
15921592
"""
15931593
Introspect *data* for units converter and update the
1594-
axis.converter instance if necessary. Return *True*
1594+
``axis.converter`` instance if necessary. Return *True*
15951595
if *data* is registered for unit conversion.
15961596
"""
15971597
converter = munits.registry.get_converter(data)
@@ -2034,7 +2034,7 @@ def _get_tick_boxes_siblings(self, renderer):
20342034
Get the bounding boxes for this `.axis` and its siblings
20352035
as set by `.Figure.align_xlabels` or `.Figure.align_ylabels`.
20362036
2037-
By default it just gets bboxes for self.
2037+
By default, it just gets bboxes for *self*.
20382038
"""
20392039
# Get the Grouper keeping track of x or y label groups for this figure.
20402040
axis_names = [
@@ -2213,7 +2213,7 @@ def _init(self):
22132213
self.offset_text_position = 'bottom'
22142214

22152215
def contains(self, mouseevent):
2216-
"""Test whether the mouse event occurred in the x axis."""
2216+
"""Test whether the mouse event occurred in the x-axis."""
22172217
inside, info = self._default_contains(mouseevent)
22182218
if inside is not None:
22192219
return inside, info

lib/matplotlib/bezier.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
A module providing some utility functions regarding Bezier path manipulation.
2+
A module providing some utility functions regarding Bézier path manipulation.
33
"""
44

55
from functools import lru_cache
@@ -94,7 +94,7 @@ def _de_casteljau1(beta, t):
9494

9595
def split_de_casteljau(beta, t):
9696
"""
97-
Split a Bezier segment defined by its control points *beta* into two
97+
Split a Bézier segment defined by its control points *beta* into two
9898
separate segments divided at *t* and return their control points.
9999
"""
100100
beta = np.asarray(beta)
@@ -113,7 +113,7 @@ def split_de_casteljau(beta, t):
113113
def find_bezier_t_intersecting_with_closedpath(
114114
bezier_point_at_t, inside_closedpath, t0=0., t1=1., tolerance=0.01):
115115
"""
116-
Find the intersection of the Bezier curve with a closed path.
116+
Find the intersection of the Bézier curve with a closed path.
117117
118118
The intersection point *t* is approximated by two parameters *t0*, *t1*
119119
such that *t0* <= *t* <= *t1*.
@@ -126,7 +126,7 @@ def find_bezier_t_intersecting_with_closedpath(
126126
Parameters
127127
----------
128128
bezier_point_at_t : callable
129-
A function returning x, y coordinates of the Bezier at parameter *t*.
129+
A function returning x, y coordinates of the Bézier at parameter *t*.
130130
It must have the signature::
131131
132132
bezier_point_at_t(t: float) -> tuple[float, float]
@@ -146,7 +146,7 @@ def find_bezier_t_intersecting_with_closedpath(
146146
Returns
147147
-------
148148
t0, t1 : float
149-
The Bezier path parameters.
149+
The Bézier path parameters.
150150
"""
151151
start = bezier_point_at_t(t0)
152152
end = bezier_point_at_t(t1)
@@ -180,7 +180,7 @@ def find_bezier_t_intersecting_with_closedpath(
180180

181181
class BezierSegment:
182182
"""
183-
A d-dimensional Bezier segment.
183+
A d-dimensional Bézier segment.
184184
185185
Parameters
186186
----------
@@ -199,7 +199,7 @@ def __init__(self, control_points):
199199

200200
def __call__(self, t):
201201
"""
202-
Evaluate the Bezier curve at point(s) t in [0, 1].
202+
Evaluate the Bézier curve at point(s) *t* in [0, 1].
203203
204204
Parameters
205205
----------
@@ -239,15 +239,15 @@ def degree(self):
239239
@property
240240
def polynomial_coefficients(self):
241241
r"""
242-
The polynomial coefficients of the Bezier curve.
242+
The polynomial coefficients of the Bézier curve.
243243
244244
.. warning:: Follows opposite convention from `numpy.polyval`.
245245
246246
Returns
247247
-------
248248
(n+1, d) array
249249
Coefficients after expanding in polynomial basis, where :math:`n`
250-
is the degree of the bezier curve and :math:`d` its dimension.
250+
is the degree of the Bézier curve and :math:`d` its dimension.
251251
These are the numbers (:math:`C_j`) such that the curve can be
252252
written :math:`\sum_{j=0}^n C_j t^j`.
253253
@@ -308,12 +308,12 @@ def axis_aligned_extrema(self):
308308
def split_bezier_intersecting_with_closedpath(
309309
bezier, inside_closedpath, tolerance=0.01):
310310
"""
311-
Split a Bezier curve into two at the intersection with a closed path.
311+
Split a Bézier curve into two at the intersection with a closed path.
312312
313313
Parameters
314314
----------
315315
bezier : (N, 2) array-like
316-
Control points of the Bezier segment. See `.BezierSegment`.
316+
Control points of the Bézier segment. See `.BezierSegment`.
317317
inside_closedpath : callable
318318
A function returning True if a given point (x, y) is inside the
319319
closed path. See also `.find_bezier_t_intersecting_with_closedpath`.
@@ -324,7 +324,7 @@ def split_bezier_intersecting_with_closedpath(
324324
Returns
325325
-------
326326
left, right
327-
Lists of control points for the two Bezier segments.
327+
Lists of control points for the two Bézier segments.
328328
"""
329329

330330
bz = BezierSegment(bezier)
@@ -461,13 +461,13 @@ def check_if_parallel(dx1, dy1, dx2, dy2, tolerance=1.e-5):
461461

462462
def get_parallels(bezier2, width):
463463
"""
464-
Given the quadratic Bezier control points *bezier2*, returns
465-
control points of quadratic Bezier lines roughly parallel to given
464+
Given the quadratic Bézier control points *bezier2*, returns
465+
control points of quadratic Bézier lines roughly parallel to given
466466
one separated by *width*.
467467
"""
468468

469469
# The parallel Bezier lines are constructed by following ways.
470-
# c1 and c2 are control points representing the begin and end of the
470+
# c1 and c2 are control points representing the start and end of the
471471
# Bezier line.
472472
# cm is the middle point
473473

@@ -485,7 +485,7 @@ def get_parallels(bezier2, width):
485485
cos_t2, sin_t2 = cos_t1, sin_t1
486486
else:
487487
# t1 and t2 is the angle between c1 and cm, cm, c2. They are
488-
# also a angle of the tangential line of the path at c1 and c2
488+
# also an angle of the tangential line of the path at c1 and c2
489489
cos_t1, sin_t1 = get_cos_sin(c1x, c1y, cmx, cmy)
490490
cos_t2, sin_t2 = get_cos_sin(cmx, cmy, c2x, c2y)
491491

@@ -535,7 +535,7 @@ def get_parallels(bezier2, width):
535535

536536
def find_control_points(c1x, c1y, mmx, mmy, c2x, c2y):
537537
"""
538-
Find control points of the Bezier curve passing through (*c1x*, *c1y*),
538+
Find control points of the Bézier curve passing through (*c1x*, *c1y*),
539539
(*mmx*, *mmy*), and (*c2x*, *c2y*), at parametric values 0, 0.5, and 1.
540540
"""
541541
cmx = .5 * (4 * mmx - (c1x + c2x))
@@ -545,8 +545,8 @@ def find_control_points(c1x, c1y, mmx, mmy, c2x, c2y):
545545

546546
def make_wedged_bezier2(bezier2, width, w1=1., wm=0.5, w2=0.):
547547
"""
548-
Being similar to get_parallels, returns control points of two quadratic
549-
Bezier lines having a width roughly parallel to given one separated by
548+
Being similar to `get_parallels`, returns control points of two quadratic
549+
Bézier lines having a width roughly parallel to given one separated by
550550
*width*.
551551
"""
552552

@@ -556,7 +556,7 @@ def make_wedged_bezier2(bezier2, width, w1=1., wm=0.5, w2=0.):
556556
c3x, c3y = bezier2[2]
557557

558558
# t1 and t2 is the angle between c1 and cm, cm, c3.
559-
# They are also a angle of the tangential line of the path at c1 and c3
559+
# They are also an angle of the tangential line of the path at c1 and c3
560560
cos_t1, sin_t1 = get_cos_sin(c1x, c1y, cmx, cmy)
561561
cos_t2, sin_t2 = get_cos_sin(cmx, cmy, c3x, c3y)
562562

lib/matplotlib/collections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def set_color(self, c):
715715
716716
Parameters
717717
----------
718-
c : color or list of rgba tuples
718+
c : color or list of RGBA tuples
719719
720720
See Also
721721
--------
@@ -1468,7 +1468,7 @@ def set_color(self, c):
14681468
----------
14691469
c : color or list of colors
14701470
Single color (all lines have same color), or a
1471-
sequence of rgba tuples; if it is a sequence the lines will
1471+
sequence of RGBA tuples; if it is a sequence the lines will
14721472
cycle through the sequence.
14731473
"""
14741474
self.set_edgecolor(c)

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ def add_lines(self, *args, **kwargs):
821821

822822
def update_ticks(self):
823823
"""
824-
Setup the ticks and ticklabels. This should not be needed by users.
824+
Set up the ticks and ticklabels. This should not be needed by users.
825825
"""
826826
# Get the locator and formatter; defaults to self._locator if not None.
827827
self._get_ticker_locator_formatter()
@@ -1024,7 +1024,7 @@ def _set_scale(self, scale, **kwargs):
10241024
10251025
Notes
10261026
-----
1027-
By default, Matplotlib supports the above mentioned scales.
1027+
By default, Matplotlib supports the above-mentioned scales.
10281028
Additionally, custom scales may be registered using
10291029
`matplotlib.scale.register_scale`. These scales can then also
10301030
be used here.

0 commit comments

Comments
 (0)