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

Skip to content

Commit a2476e7

Browse files
authored
Merge pull request #10433 from matplotlib/auto-backport-of-pr-10427
Backport PR #10427 on branch v2.2.x
2 parents dc3276d + 0888eb0 commit a2476e7

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def DEBUG_MSG(string, lvl=3, o=None):
6262
# Jeremy, often times the commented line won't print but the
6363
# one below does. I think WX is redefining stderr, damned
6464
# beast
65-
# print >>sys.stderr, "%s- %s in %s" % (_DEBUG_lvls[lvl], string, cls)
65+
# print("%s- %s in %s" % (_DEBUG_lvls[lvl], string, cls),
66+
# file=sys.stderr)
6667
print("%s- %s in %s" % (_DEBUG_lvls[lvl], string, cls))
6768

6869

lib/matplotlib/dviread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ class Dvi(object):
191191
192192
>>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi:
193193
>>> for page in dvi:
194-
>>> print ''.join(unichr(t.glyph) for t in page.text)
194+
>>> print(''.join(unichr(t.glyph) for t in page.text))
195195
"""
196196
# dispatch table
197197
_dtable = [None for _ in xrange(256)]

lib/matplotlib/lines.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,21 @@ def segment_hits(cx, cy, x, y, radius):
9393
Lnorm_sq = dx ** 2 + dy ** 2 # Possibly want to eliminate Lnorm==0
9494
u = ((cx - xr) * dx + (cy - yr) * dy) / Lnorm_sq
9595
candidates = (u >= 0) & (u <= 1)
96-
#if any(candidates): print "candidates",xr[candidates]
9796

9897
# Note that there is a little area near one side of each point
9998
# which will be near neither segment, and another which will
10099
# be near both, depending on the angle of the lines. The
101100
# following radius test eliminates these ambiguities.
102101
point_hits = (cx - x) ** 2 + (cy - y) ** 2 <= radius ** 2
103-
#if any(point_hits): print "points",xr[candidates]
104102
candidates = candidates & ~(point_hits[:-1] | point_hits[1:])
105103

106104
# For those candidates which remain, determine how far they lie away
107105
# from the line.
108106
px, py = xr + u * dx, yr + u * dy
109107
line_hits = (cx - px) ** 2 + (cy - py) ** 2 <= radius ** 2
110-
#if any(line_hits): print "lines",xr[candidates]
111108
line_hits = line_hits & candidates
112109
points, = point_hits.ravel().nonzero()
113110
lines, = line_hits.ravel().nonzero()
114-
#print points,lines
115111
return np.concatenate((points, lines))
116112

117113

lib/mpl_toolkits/axisartist/angle_helper.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,9 @@ def select_step(v1, v2, nv, hour=False, include_last=True,
114114

115115
# for degree
116116
if dv > 1./threshold_factor:
117-
#print "degree"
118117
step, factor = _select_step(dv)
119118
else:
120119
step, factor = select_step_sub(dv*threshold_factor)
121-
#print "feac", step, factor
122120

123121
factor = factor * threshold_factor
124122

tutorials/intermediate/artists.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class in the matplotlib API, and the one you will be working with most
304304
# In [159]: ax1
305305
# Out[159]: <matplotlib.axes.Subplot instance at 0xd54b26c>
306306
#
307-
# In [160]: print fig.axes
307+
# In [160]: print(fig.axes)
308308
# [<matplotlib.axes.Subplot instance at 0xd54b26c>, <matplotlib.axes.Axes instance at 0xd3f0b2c>]
309309
#
310310
# Because the figure maintains the concept of the "current axes" (see
@@ -404,7 +404,7 @@ class in the matplotlib API, and the one you will be working with most
404404
#
405405
# .. sourcecode:: ipython
406406
#
407-
# In [229]: print ax.lines
407+
# In [229]: print(ax.lines)
408408
# [<matplotlib.lines.Line2D instance at 0xd378b0c>]
409409
#
410410
# Similarly, methods that create patches, like
@@ -419,7 +419,7 @@ class in the matplotlib API, and the one you will be working with most
419419
# In [234]: rectangles
420420
# Out[234]: <a list of 50 Patch objects>
421421
#
422-
# In [235]: print len(ax.patches)
422+
# In [235]: print(len(ax.patches))
423423
#
424424
# You should not add objects directly to the ``Axes.lines`` or
425425
# ``Axes.patches`` lists unless you know exactly what you are doing,
@@ -445,42 +445,42 @@ class in the matplotlib API, and the one you will be working with most
445445
# In [263]: rect = matplotlib.patches.Rectangle( (1,1), width=5, height=12)
446446
#
447447
# # by default the axes instance is None
448-
# In [264]: print rect.get_axes()
448+
# In [264]: print(rect.get_axes())
449449
# None
450450
#
451451
# # and the transformation instance is set to the "identity transform"
452-
# In [265]: print rect.get_transform()
452+
# In [265]: print(rect.get_transform())
453453
# <Affine object at 0x13695544>
454454
#
455455
# # now we add the Rectangle to the Axes
456456
# In [266]: ax.add_patch(rect)
457457
#
458458
# # and notice that the ax.add_patch method has set the axes
459459
# # instance
460-
# In [267]: print rect.get_axes()
460+
# In [267]: print(rect.get_axes())
461461
# Axes(0.125,0.1;0.775x0.8)
462462
#
463463
# # and the transformation has been set too
464-
# In [268]: print rect.get_transform()
464+
# In [268]: print(rect.get_transform())
465465
# <Affine object at 0x15009ca4>
466466
#
467467
# # the default axes transformation is ax.transData
468-
# In [269]: print ax.transData
468+
# In [269]: print(ax.transData)
469469
# <Affine object at 0x15009ca4>
470470
#
471471
# # notice that the xlimits of the Axes have not been changed
472-
# In [270]: print ax.get_xlim()
472+
# In [270]: print(ax.get_xlim())
473473
# (0.0, 1.0)
474474
#
475475
# # but the data limits have been updated to encompass the rectangle
476-
# In [271]: print ax.dataLim.bounds
476+
# In [271]: print(ax.dataLim.bounds)
477477
# (1.0, 1.0, 5.0, 12.0)
478478
#
479479
# # we can manually invoke the auto-scaling machinery
480480
# In [272]: ax.autoscale_view()
481481
#
482482
# # and now the xlim are updated to encompass the rectangle
483-
# In [273]: print ax.get_xlim()
483+
# In [273]: print(ax.get_xlim())
484484
# (1.0, 6.0)
485485
#
486486
# # we have to manually force a figure draw

0 commit comments

Comments
 (0)