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

Skip to content

Cleanup old print statements #10427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/matplotlib/backends/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def DEBUG_MSG(string, lvl=3, o=None):
# Jeremy, often times the commented line won't print but the
# one below does. I think WX is redefining stderr, damned
# beast
# print >>sys.stderr, "%s- %s in %s" % (_DEBUG_lvls[lvl], string, cls)
# print("%s- %s in %s" % (_DEBUG_lvls[lvl], string, cls),
# file=sys.stderr)
print("%s- %s in %s" % (_DEBUG_lvls[lvl], string, cls))


Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class Dvi(object):

>>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi:
>>> for page in dvi:
>>> print ''.join(unichr(t.glyph) for t in page.text)
>>> print(''.join(unichr(t.glyph) for t in page.text))
"""
# dispatch table
_dtable = [None for _ in xrange(256)]
Expand Down
4 changes: 0 additions & 4 deletions lib/matplotlib/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,21 @@ def segment_hits(cx, cy, x, y, radius):
Lnorm_sq = dx ** 2 + dy ** 2 # Possibly want to eliminate Lnorm==0
u = ((cx - xr) * dx + (cy - yr) * dy) / Lnorm_sq
candidates = (u >= 0) & (u <= 1)
#if any(candidates): print "candidates",xr[candidates]

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

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


Expand Down
2 changes: 0 additions & 2 deletions lib/mpl_toolkits/axisartist/angle_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@ def select_step(v1, v2, nv, hour=False, include_last=True,

# for degree
if dv > 1./threshold_factor:
#print "degree"
step, factor = _select_step(dv)
else:
step, factor = select_step_sub(dv*threshold_factor)
#print "feac", step, factor

factor = factor * threshold_factor

Expand Down
22 changes: 11 additions & 11 deletions tutorials/intermediate/artists.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class in the matplotlib API, and the one you will be working with most
# In [159]: ax1
# Out[159]: <matplotlib.axes.Subplot instance at 0xd54b26c>
#
# In [160]: print fig.axes
# In [160]: print(fig.axes)
# [<matplotlib.axes.Subplot instance at 0xd54b26c>, <matplotlib.axes.Axes instance at 0xd3f0b2c>]
#
# Because the figure maintains the concept of the "current axes" (see
Expand Down Expand Up @@ -404,7 +404,7 @@ class in the matplotlib API, and the one you will be working with most
#
# .. sourcecode:: ipython
#
# In [229]: print ax.lines
# In [229]: print(ax.lines)
# [<matplotlib.lines.Line2D instance at 0xd378b0c>]
#
# Similarly, methods that create patches, like
Expand All @@ -419,7 +419,7 @@ class in the matplotlib API, and the one you will be working with most
# In [234]: rectangles
# Out[234]: <a list of 50 Patch objects>
#
# In [235]: print len(ax.patches)
# In [235]: print(len(ax.patches))
#
# You should not add objects directly to the ``Axes.lines`` or
# ``Axes.patches`` lists unless you know exactly what you are doing,
Expand All @@ -445,42 +445,42 @@ class in the matplotlib API, and the one you will be working with most
# In [263]: rect = matplotlib.patches.Rectangle( (1,1), width=5, height=12)
#
# # by default the axes instance is None
# In [264]: print rect.get_axes()
# In [264]: print(rect.get_axes())
# None
#
# # and the transformation instance is set to the "identity transform"
# In [265]: print rect.get_transform()
# In [265]: print(rect.get_transform())
# <Affine object at 0x13695544>
#
# # now we add the Rectangle to the Axes
# In [266]: ax.add_patch(rect)
#
# # and notice that the ax.add_patch method has set the axes
# # instance
# In [267]: print rect.get_axes()
# In [267]: print(rect.get_axes())
# Axes(0.125,0.1;0.775x0.8)
#
# # and the transformation has been set too
# In [268]: print rect.get_transform()
# In [268]: print(rect.get_transform())
# <Affine object at 0x15009ca4>
#
# # the default axes transformation is ax.transData
# In [269]: print ax.transData
# In [269]: print(ax.transData)
# <Affine object at 0x15009ca4>
#
# # notice that the xlimits of the Axes have not been changed
# In [270]: print ax.get_xlim()
# In [270]: print(ax.get_xlim())
# (0.0, 1.0)
#
# # but the data limits have been updated to encompass the rectangle
# In [271]: print ax.dataLim.bounds
# In [271]: print(ax.dataLim.bounds)
# (1.0, 1.0, 5.0, 12.0)
#
# # we can manually invoke the auto-scaling machinery
# In [272]: ax.autoscale_view()
#
# # and now the xlim are updated to encompass the rectangle
# In [273]: print ax.get_xlim()
# In [273]: print(ax.get_xlim())
# (1.0, 6.0)
#
# # we have to manually force a figure draw
Expand Down