From e202ee5e6148fb862bf458a2c03c3e6b2fdc176f Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Mon, 4 Feb 2019 00:37:57 +0100 Subject: [PATCH] More spelling fixes. --- doc/sphinxext/gallery_order.py | 2 +- examples/images_contours_and_fields/image_masked.py | 2 +- examples/ticks_and_spines/date_concise_formatter.py | 2 +- lib/matplotlib/artist.py | 2 +- lib/matplotlib/axes/_axes.py | 10 +++++----- lib/matplotlib/backends/backend_pgf.py | 2 +- lib/matplotlib/backends/backend_wx.py | 11 +++-------- lib/matplotlib/bezier.py | 8 ++++---- lib/matplotlib/cbook/deprecation.py | 2 +- lib/matplotlib/collections.py | 2 +- lib/matplotlib/colors.py | 3 +-- lib/matplotlib/legend.py | 2 +- lib/matplotlib/mathtext.py | 2 +- lib/matplotlib/offsetbox.py | 2 +- lib/matplotlib/pylab.py | 6 +++--- lib/matplotlib/testing/jpl_units/Epoch.py | 2 +- lib/matplotlib/testing/jpl_units/UnitDbl.py | 2 +- ...atters.pdf => twin_axis_locators_formatters.pdf} | Bin ...atters.png => twin_axis_locators_formatters.png} | Bin ...atters.svg => twin_axis_locators_formatters.svg} | 0 lib/matplotlib/tests/test_axes.py | 6 +++--- lib/matplotlib/tests/test_legend.py | 2 +- lib/matplotlib/tests/test_rcparams.py | 2 +- lib/matplotlib/textpath.py | 2 +- lib/matplotlib/ticker.py | 2 +- lib/matplotlib/widgets.py | 3 +-- tutorials/toolkits/axisartist.py | 4 ++-- 27 files changed, 38 insertions(+), 45 deletions(-) rename lib/matplotlib/tests/baseline_images/test_axes/{twin_axis_locaters_formatters.pdf => twin_axis_locators_formatters.pdf} (100%) rename lib/matplotlib/tests/baseline_images/test_axes/{twin_axis_locaters_formatters.png => twin_axis_locators_formatters.png} (100%) rename lib/matplotlib/tests/baseline_images/test_axes/{twin_axis_locaters_formatters.svg => twin_axis_locators_formatters.svg} (100%) diff --git a/doc/sphinxext/gallery_order.py b/doc/sphinxext/gallery_order.py index 9229ea7ef97e..5b598b977c47 100644 --- a/doc/sphinxext/gallery_order.py +++ b/doc/sphinxext/gallery_order.py @@ -6,7 +6,7 @@ from sphinx_gallery.sorting import ExplicitOrder -# Gallery sections shall be diplayed in the following order. +# Gallery sections shall be displayed in the following order. # Non-matching sections are appended. explicit_order_folders = [ '../examples/lines_bars_and_markers', diff --git a/examples/images_contours_and_fields/image_masked.py b/examples/images_contours_and_fields/image_masked.py index b8f13c5726c8..15a78f7123ce 100644 --- a/examples/images_contours_and_fields/image_masked.py +++ b/examples/images_contours_and_fields/image_masked.py @@ -42,7 +42,7 @@ # range to which the regular palette color scale is applied. # Anything above that range is colored based on palette.set_over, etc. -# set up the Axes objets +# set up the Axes objects fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(6, 5.4)) # plot using 'continuous' color map diff --git a/examples/ticks_and_spines/date_concise_formatter.py b/examples/ticks_and_spines/date_concise_formatter.py index a672d80a0139..da172c597cf8 100644 --- a/examples/ticks_and_spines/date_concise_formatter.py +++ b/examples/ticks_and_spines/date_concise_formatter.py @@ -97,7 +97,7 @@ # ticks that are "zeros". These are tick values that are either the first of # the year, month, or day of month, or the zeroth hour, minute, or second. # These are usually the same as the format of -# the ticks a level above. For example if the axis limts mean the ticks are +# the ticks a level above. For example if the axis limits mean the ticks are # mostly days, then we label 1 Mar 2005 simply with a "Mar". If the axis # limits are mostly hours, we label Feb 4 00:00 as simply "Feb-4". # diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index c1e7c7a67c76..bf096888ea66 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -1002,7 +1002,7 @@ def sticky_edges(self): When performing autoscaling, if a data limit coincides with a value in the corresponding sticky_edges list, then no margin will be added--the - view limit "sticks" to the edge. A typical usecase is histograms, + view limit "sticks" to the edge. A typical use case is histograms, where one usually expects no margin on the bottom edge (0) of the histogram. diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 253d36333dd6..b2f406d46925 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4464,7 +4464,7 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None, marginals : bool, optional, default is *False* if marginals is *True*, plot the marginal density as - colormapped rectagles along the bottom of the x-axis and + colormapped rectangles along the bottom of the x-axis and left of the y-axis extent : scalar, optional, default is *None* @@ -5064,7 +5064,7 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False, position remain unfilled due to the adjacent *False* values. interpolate : bool, optional - This option is only relvant if *where* is used and the two curves + This option is only relevant if *where* is used and the two curves are crossing each other. Semantically, *where* is often used for *y1* > *y2* or similar. @@ -5246,7 +5246,7 @@ def fill_betweenx(self, y, x1, x2=0, where=None, position remain unfilled due to the adjacent *False* values. interpolate : bool, optional - This option is only relvant if *where* is used and the two curves + This option is only relevant if *where* is used and the two curves are crossing each other. Semantically, *where* is often used for *x1* > *x2* or similar. @@ -5257,7 +5257,7 @@ def fill_betweenx(self, y, x1, x2=0, where=None, simply clipped. Setting *interpolate* to *True* will calculate the actual - interscection point and extend the filled region up to this point. + intersection point and extend the filled region up to this point. step : {'pre', 'post', 'mid'}, optional Define *step* if the filling should be a step function, @@ -6139,7 +6139,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None, X, Y : tuple or array-like, default: ``(0, N)``, ``(0, M)`` *X* and *Y* are used to specify the coordinates of the - quadilaterals. There are different ways to do this: + quadrilaterals. There are different ways to do this: - Use tuples ``X=(xmin, xmax)`` and ``Y=(ymin, ymax)`` to define a *uniform rectangular grid*. diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py index 0ddd4e5a2716..1c4a61fa2796 100644 --- a/lib/matplotlib/backends/backend_pgf.py +++ b/lib/matplotlib/backends/backend_pgf.py @@ -214,7 +214,7 @@ class LatexManager: """ The LatexManager opens an instance of the LaTeX application for determining the metrics of text elements. The LaTeX environment can be - modified by setting fonts and/or a custem preamble in the rc parameters. + modified by setting fonts and/or a custom preamble in the rc parameters. """ _unclean_instances = weakref.WeakSet() diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 0a45edfbbde0..d235a1d90394 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -147,7 +147,7 @@ class RendererWx(RendererBase): 'renderer' instance used by many classes in the hierarchy. """ # In wxPython, drawing is performed on a wxDC instance, which will - # generally be mapped to the client aread of the window displaying + # generally be mapped to the client area of the window displaying # the plot. Under wxPython, the wxDC instance has a wx.Pen which # describes the colour and weight of any lines drawn, and a wxBrush # which describes the fill colour of any closed polygon. @@ -429,18 +429,13 @@ def __init__(self, bitmap, renderer): self.renderer = renderer def select(self): - """ - Select the current bitmap into this wxDC instance - """ - + """Select the current bitmap into this wxDC instance.""" if sys.platform == 'win32': self.dc.SelectObject(self.bitmap) self.IsSelected = True def unselect(self): - """ - Select a Null bitmasp into this wxDC instance - """ + """Select a Null bitmap into this wxDC instance.""" if sys.platform == 'win32': self.dc.SelectObject(wx.NullBitmap) self.IsSelected = False diff --git a/lib/matplotlib/bezier.py b/lib/matplotlib/bezier.py index 0308aa1beeac..c96e2544cf96 100644 --- a/lib/matplotlib/bezier.py +++ b/lib/matplotlib/bezier.py @@ -101,7 +101,7 @@ def find_bezier_t_intersecting_with_closedpath( bounds the intersecting points with a provided closed path(*inside_closedpath*). Search starts from *t0* and *t1* and it uses a simple bisecting algorithm therefore one of the end point - must be inside the path while the orther doesn't. The search stop + must be inside the path while the other doesn't. The search stop when |t0-t1| gets smaller than the given tolerance. value for @@ -307,8 +307,8 @@ def get_cos_sin(x0, y0, x1, y1): @cbook._rename_parameter("3.1", "tolerence", "tolerance") def check_if_parallel(dx1, dy1, dx2, dy2, tolerance=1.e-5): """ returns - * 1 if two lines are parralel in same direction - * -1 if two lines are parralel in opposite direction + * 1 if two lines are parallel in same direction + * -1 if two lines are parallel in opposite direction * 0 otherwise """ theta1 = np.arctan2(dx1, dy1) @@ -368,7 +368,7 @@ def get_parallels(bezier2, width): # t2. Same with cm_right. if parallel_test != 0: # a special case for a straight line, i.e., angle between two - # lines are smaller than some (arbitrtay) value. + # lines are smaller than some (arbitrary) value. cmx_left, cmy_left = ( 0.5 * (c1x_left + c2x_left), 0.5 * (c1y_left + c2y_left) ) diff --git a/lib/matplotlib/cbook/deprecation.py b/lib/matplotlib/cbook/deprecation.py index 7a02f3c6c8e5..a48af79c5fa8 100644 --- a/lib/matplotlib/cbook/deprecation.py +++ b/lib/matplotlib/cbook/deprecation.py @@ -251,7 +251,7 @@ def wrapper(*args, **kwargs): ' {message}' .format(since=since, message=message, old_doc=old_doc)) if not old_doc: - # This is to prevent a spurious 'unexected unindent' warning from + # This is to prevent a spurious 'unexpected unindent' warning from # docutils when the original docstring was blank. new_doc += r'\ ' diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py index a58d60e19d65..cfa57b4fe607 100644 --- a/lib/matplotlib/collections.py +++ b/lib/matplotlib/collections.py @@ -6,7 +6,7 @@ The classes are not meant to be as flexible as their single element counterparts (e.g., you may not be able to select all line styles) but they are meant to be fast for common use cases (e.g., a large set of solid -line segemnts) +line segments). """ import math diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index 6b8653e4583b..c3d8b4871bb1 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -1848,8 +1848,7 @@ def from_levels_and_colors(levels, colors, extend='neither'): ---------- levels : sequence of numbers The quantization levels used to construct the :class:`BoundaryNorm`. - Values ``v`` are quantizized to level ``i`` if - ``lev[i] <= v < lev[i+1]``. + Value ``v`` is quantized to level ``i`` if ``lev[i] <= v < lev[i+1]``. colors : sequence of colors The fill color to use for each level. If `extend` is "neither" there must be ``n_level - 1`` colors. For an `extend` of "min" or "max" add diff --git a/lib/matplotlib/legend.py b/lib/matplotlib/legend.py index 7e4009806ab3..d017f80a9ae3 100644 --- a/lib/matplotlib/legend.py +++ b/lib/matplotlib/legend.py @@ -790,7 +790,7 @@ def _init_legend_box(self, handles, labels, markerfirst=True): # be given in the display coordinates. # The transformation of each handle will be automatically set - # to self.get_trasnform(). If the artist does not use its + # to self.get_transform(). If the artist does not use its # default transform (e.g., Collections), you need to # manually set their transform to the self.get_transform(). legend_handler_map = self.get_legend_handler_map() diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 601bfdfc78bc..909d313be628 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -3023,7 +3023,7 @@ def subsuper(self, s, loc, toks): return [result] # We remove kerning on the last character for consistency (otherwise - # it will compute kerning based on non-shrinked characters and may put + # it will compute kerning based on non-shrunk characters and may put # them too close together when superscripted) # We change the width of the last character to match the advance to # consider some fonts with weird metrics: e.g. stix's f has a width of diff --git a/lib/matplotlib/offsetbox.py b/lib/matplotlib/offsetbox.py index 9a4b787f944e..70a6d9c54f8b 100644 --- a/lib/matplotlib/offsetbox.py +++ b/lib/matplotlib/offsetbox.py @@ -932,7 +932,7 @@ def get_extent(self, renderer): bboxes = [c.get_window_extent(renderer) for c in self._children] ub = mtransforms.Bbox.union(bboxes) - # adjust ref_offset_tansform + # adjust ref_offset_transform self.ref_offset_transform.translate(-ub.x0, -ub.y0) # restor offset transform diff --git a/lib/matplotlib/pylab.py b/lib/matplotlib/pylab.py index 2bdda52026b0..923acff19af5 100644 --- a/lib/matplotlib/pylab.py +++ b/lib/matplotlib/pylab.py @@ -176,14 +176,14 @@ bartlett - M-point Bartlett window blackman - M-point Blackman window - cohere - the coherence using average periodiogram - csd - the cross spectral density using average periodiogram + cohere - the coherence using average periodogram + csd - the cross spectral density using average periodogram fft - the fast Fourier transform of vector x hamming - M-point Hamming window hanning - M-point Hanning window hist - compute the histogram of x kaiser - M length Kaiser window - psd - the power spectral density using average periodiogram + psd - the power spectral density using average periodogram sinc - the sinc function of array x _Dates diff --git a/lib/matplotlib/testing/jpl_units/Epoch.py b/lib/matplotlib/testing/jpl_units/Epoch.py index fb607d760598..8de9dfd0ce3a 100644 --- a/lib/matplotlib/testing/jpl_units/Epoch.py +++ b/lib/matplotlib/testing/jpl_units/Epoch.py @@ -213,7 +213,7 @@ def range(start, stop, step): - step Step to use. = RETURN VALUE - - Returns a list contianing the requested Epoch values. + - Returns a list containing the requested Epoch values. """ elems = [] diff --git a/lib/matplotlib/testing/jpl_units/UnitDbl.py b/lib/matplotlib/testing/jpl_units/UnitDbl.py index 898e1bae43c0..ee5b6ec2189a 100644 --- a/lib/matplotlib/testing/jpl_units/UnitDbl.py +++ b/lib/matplotlib/testing/jpl_units/UnitDbl.py @@ -217,7 +217,7 @@ def range(start, stop, step=None): value 1 w/ the units of the start is used. = RETURN VALUE - - Returns a list contianing the requested UnitDbl values. + - Returns a list containing the requested UnitDbl values. """ if step is None: step = UnitDbl(1, start._units) diff --git a/lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locaters_formatters.pdf b/lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locators_formatters.pdf similarity index 100% rename from lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locaters_formatters.pdf rename to lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locators_formatters.pdf diff --git a/lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locaters_formatters.png b/lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locators_formatters.png similarity index 100% rename from lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locaters_formatters.png rename to lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locators_formatters.png diff --git a/lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locaters_formatters.svg b/lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locators_formatters.svg similarity index 100% rename from lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locaters_formatters.svg rename to lib/matplotlib/tests/baseline_images/test_axes/twin_axis_locators_formatters.svg diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 5d157915dd99..79fbd7179beb 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -132,8 +132,8 @@ def test_formatter_ticker(): ax.autoscale_view() -@image_comparison(baseline_images=["twin_axis_locaters_formatters"]) -def test_twin_axis_locaters_formatters(): +@image_comparison(baseline_images=["twin_axis_locators_formatters"]) +def test_twin_axis_locators_formatters(): vals = np.linspace(0, 1, num=5, endpoint=True) locs = np.sin(np.pi * vals / 2.0) @@ -616,7 +616,7 @@ def test_shaped_data(): def test_structured_data(): - # support for stuctured data + # support for structured data pts = np.array([(1, 1), (2, 2)], dtype=[("ones", float), ("twos", float)]) # this should not read second name as a format and raise ValueError diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py index b0f8dfaee3eb..b4bcecde81fa 100644 --- a/lib/matplotlib/tests/test_legend.py +++ b/lib/matplotlib/tests/test_legend.py @@ -470,7 +470,7 @@ def test_linecollection_scaled_dashes(): def test_handler_numpoints(): - '''test legend handler with numponts less than or equal to 1''' + """Test legend handler with numpoints <= 1.""" # related to #6921 and PR #8478 fig, ax = plt.subplots() ax.plot(range(5), label='test') diff --git a/lib/matplotlib/tests/test_rcparams.py b/lib/matplotlib/tests/test_rcparams.py index 6634481c49b4..e2177d1ccfc3 100644 --- a/lib/matplotlib/tests/test_rcparams.py +++ b/lib/matplotlib/tests/test_rcparams.py @@ -39,7 +39,7 @@ def test_rcparams(): assert mpl.rcParams['text.usetex'] == (not usetex) assert mpl.rcParams['text.usetex'] == usetex - # test context given filename (mpl.rc sets linewdith to 33) + # test context given filename (mpl.rc sets linewidth to 33) with mpl.rc_context(fname=fname): assert mpl.rcParams['lines.linewidth'] == 33 assert mpl.rcParams['lines.linewidth'] == linewidth diff --git a/lib/matplotlib/textpath.py b/lib/matplotlib/textpath.py index 4d684ebfd0e9..97eb3eefa95c 100644 --- a/lib/matplotlib/textpath.py +++ b/lib/matplotlib/textpath.py @@ -451,7 +451,7 @@ def __init__(self, xy, s, size=None, prop=None, if args or kwargs: cbook.warn_deprecated( - "3.1", message="Additional agruments to TextPath used to be " + "3.1", message="Additional arguments to TextPath used to be " "ignored, but will trigger a TypeError %(removal)s.") if prop is None: diff --git a/lib/matplotlib/ticker.py b/lib/matplotlib/ticker.py index d59a53598718..f952e604a12a 100644 --- a/lib/matplotlib/ticker.py +++ b/lib/matplotlib/ticker.py @@ -1441,7 +1441,7 @@ def tick_values(self, vmin, vmax): def set_params(self, **kwargs): """ - Do nothing, and rase a warning. Any locator class not supporting the + Do nothing, and raise a warning. Any locator class not supporting the set_params() function will call this. """ cbook._warn_external( diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index 890150aa0ca5..009998a53680 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -2188,8 +2188,7 @@ def _release(self, event): if self.spancoords == 'data': xmin, ymin = self.eventpress.xdata, self.eventpress.ydata xmax, ymax = self.eventrelease.xdata, self.eventrelease.ydata - # calcultate dimensions of box or line get values in the right - # order + # calculate dimensions of box or line get values in the right order elif self.spancoords == 'pixels': xmin, ymin = self.eventpress.x, self.eventpress.y xmax, ymax = self.eventrelease.x, self.eventrelease.y diff --git a/tutorials/toolkits/axisartist.py b/tutorials/toolkits/axisartist.py index 2e9f233b03f7..ce227e0ef262 100644 --- a/tutorials/toolkits/axisartist.py +++ b/tutorials/toolkits/axisartist.py @@ -247,7 +247,7 @@ ax.axis["bottom"].major_ticklabels.set_visible(False) -AxisAritst provides a helper method to control the visibility of ticks, +AxisArtist provides a helper method to control the visibility of ticks, ticklabels, and label. To make ticklabel invisible, :: ax.axis["bottom"].toggle(ticklabels=False) @@ -415,7 +415,7 @@ Demo Axis Direction The axis_direction can be adjusted in the AxisArtist level, or in the -level of its child arists, i.e., ticks, ticklabels, and axis-label. :: +level of its child artists, i.e., ticks, ticklabels, and axis-label. :: ax1.axis["left"].set_axis_direction("top")