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

Skip to content

Commit dfb8936

Browse files
authored
Merge pull request #11616 from QuLogic/doctest-fixes
DOC: Fix some doctest issues
2 parents e8120cf + c7d7a91 commit dfb8936

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ def plot(self, *args, scalex=True, scaley=True, **kwargs):
11471147
11481148
>>> plot(x, y, 'go--', linewidth=2, markersize=12)
11491149
>>> plot(x, y, color='green', marker='o', linestyle='dashed',
1150-
linewidth=2, markersize=12)
1150+
... linewidth=2, markersize=12)
11511151
11521152
When conflicting with *fmt*, keyword arguments take precedence.
11531153

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ def _array_perimeter(arr):
20372037
array([[ 0, 1, 2, 3],
20382038
[10, 11, 12, 13],
20392039
[20, 21, 22, 23]])
2040-
>>> _array_perimeter(arr)
2040+
>>> _array_perimeter(a)
20412041
array([ 0, 1, 2, 3, 13, 23, 22, 21, 20, 10])
20422042
"""
20432043
# note we use Python's half-open ranges to avoid repeating

lib/matplotlib/dviread.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ class Dvi(object):
177177
file upon exit. Pages can be read via iteration. Here is an overly
178178
simple way to extract text without trying to detect whitespace::
179179
180-
>>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi:
181-
>>> for page in dvi:
182-
>>> print(''.join(chr(t.glyph) for t in page.text))
180+
>>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi:
181+
... for page in dvi:
182+
... print(''.join(chr(t.glyph) for t in page.text))
183183
"""
184184
# dispatch table
185185
_dtable = [None] * 256

lib/matplotlib/ticker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,9 +1420,9 @@ def tick_values(self, vmin, vmax):
14201420
automatically for the associated :attr:`axis` simply call
14211421
the Locator instance::
14221422
1423-
>>> print((type(loc)))
1423+
>>> print(type(loc))
14241424
<type 'Locator'>
1425-
>>> print((loc()))
1425+
>>> print(loc())
14261426
[1, 2, 3, 4]
14271427
14281428
"""

lib/matplotlib/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,10 +1714,10 @@ class SpanSelector(_SelectorWidget):
17141714
>>> fig, ax = plt.subplots()
17151715
>>> ax.plot([1, 2, 3], [10, 50, 100])
17161716
>>> def onselect(vmin, vmax):
1717-
print(vmin, vmax)
1717+
... print(vmin, vmax)
17181718
>>> rectprops = dict(facecolor='blue', alpha=0.5)
17191719
>>> span = mwidgets.SpanSelector(ax, onselect, 'horizontal',
1720-
rectprops=rectprops)
1720+
... rectprops=rectprops)
17211721
>>> fig.show()
17221722
17231723
See also: :doc:`/gallery/widgets/span_selector`

lib/mpl_toolkits/axes_grid1/anchored_artists.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ def __init__(self, transform, size, label, loc,
321321
--------
322322
>>> import matplotlib.pyplot as plt
323323
>>> import numpy as np
324-
>>> from mpl_toolkits.axes_grid1.anchored_artists import \
325-
AnchoredSizeBar
324+
>>> from mpl_toolkits.axes_grid1.anchored_artists import (
325+
... AnchoredSizeBar)
326326
>>> fig, ax = plt.subplots()
327327
>>> ax.imshow(np.random.random((10,10)))
328328
>>> bar = AnchoredSizeBar(ax.transData, 3, '3 data units', 4)
@@ -333,10 +333,10 @@ def __init__(self, transform, size, label, loc,
333333
334334
>>> import matplotlib.font_manager as fm
335335
>>> fontprops = fm.FontProperties(size=14, family='monospace')
336-
>>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5, \
337-
sep=5, borderpad=0.5, frameon=False, \
338-
size_vertical=0.5, color='white', \
339-
fontproperties=fontprops)
336+
>>> bar = AnchoredSizeBar(ax.transData, 3, '3 units', 4, pad=0.5,
337+
... sep=5, borderpad=0.5, frameon=False,
338+
... size_vertical=0.5, color='white',
339+
... fontproperties=fontprops)
340340
"""
341341
if fill_bar is None:
342342
fill_bar = size_vertical > 0
@@ -505,8 +505,8 @@ def __init__(self, transform, label_x, label_y, length=0.15,
505505
--------
506506
>>> import matplotlib.pyplot as plt
507507
>>> import numpy as np
508-
>>> from mpl_toolkits.axes_grid1.anchored_artists import \
509-
... AnchoredDirectionArrows
508+
>>> from mpl_toolkits.axes_grid1.anchored_artists import (
509+
... AnchoredDirectionArrows)
510510
>>> fig, ax = plt.subplots()
511511
>>> ax.imshow(np.random.random((10,10)))
512512
>>> arrows = AnchoredDirectionArrows(ax.transAxes, '111', '110')
@@ -519,9 +519,11 @@ def __init__(self, transform, label_x, label_y, length=0.15,
519519
>>> import matplotlib.font_manager as fm
520520
>>> fontprops = fm.FontProperties(family='monospace')
521521
>>> arrows = AnchoredDirectionArrows(ax.transAxes, 'East', 'South',
522-
... loc='lower left', color='k', aspect_ratio=-1, sep_x=0.02,
523-
... sep_y=-0.01, text_props={'ec':'w', 'fc':'k'},
524-
... fontproperties=fontprops)
522+
... loc='lower left', color='k',
523+
... aspect_ratio=-1, sep_x=0.02,
524+
... sep_y=-0.01,
525+
... text_props={'ec':'w', 'fc':'k'},
526+
... fontproperties=fontprops)
525527
"""
526528
if arrow_props is None:
527529
arrow_props = {}

0 commit comments

Comments
 (0)