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

Skip to content

Commit c433150

Browse files
committed
Merge branch 'print_function' of git://github.com/mdboom/matplotlib-py3 into mdboom-print_function
Conflicts: lib/matplotlib/finance.py
2 parents b166ccb + a32eb4e commit c433150

201 files changed

Lines changed: 606 additions & 370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/make.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env python
2+
3+
from __future__ import print_function
24
import fileinput
35
import glob
46
import os
@@ -58,7 +60,7 @@ def latex():
5860

5961
os.chdir('../..')
6062
else:
61-
print 'latex build has not been tested on windows'
63+
print('latex build has not been tested on windows')
6264

6365
def clean():
6466
shutil.rmtree("build", ignore_errors=True)

doc/pyplots/make.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env python
2+
3+
from __future__ import print_function
24
import sys, os, glob
35
import matplotlib
46
import IPython.Shell
@@ -12,7 +14,7 @@
1214
('pdf', 72)]
1315

1416
def figs():
15-
print 'making figs'
17+
print('making figs')
1618
import matplotlib.pyplot as plt
1719
for fname in glob.glob('*.py'):
1820
if fname.split('/')[-1] == __file__.split('/')[-1]: continue
@@ -26,9 +28,9 @@ def figs():
2628
break
2729

2830
if all_exists:
29-
print ' already have %s'%fname
31+
print(' already have %s'%fname)
3032
else:
31-
print ' building %s'%fname
33+
print(' building %s'%fname)
3234
plt.close('all') # we need to clear between runs
3335
mplshell.magic_run(basename)
3436
for imagefile, dpi in imagefiles.iteritems():
@@ -37,7 +39,7 @@ def figs():
3739
# iles preventing them from getting built successfully
3840
# later
3941
plt.savefig(imagefile, dpi=dpi)
40-
print 'all figures made'
42+
print('all figures made')
4143

4244

4345
def clean():
@@ -46,7 +48,7 @@ def clean():
4648
for pattern in patterns:
4749
for fname in glob.glob(pattern):
4850
os.remove(fname)
49-
print 'all clean'
51+
print('all clean')
5052

5153

5254

doc/sphinxext/gen_rst.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
generate the rst files for the examples by iterating over the pylab examples
33
"""
4+
from __future__ import print_function
45
import os, glob
56

67
import os
@@ -152,7 +153,7 @@ def generate_example_rst(app):
152153

153154
fhindex.close()
154155

155-
print
156+
print()
156157

157158
def setup(app):
158159
app.connect('builder-inited', generate_example_rst)

doc/sphinxext/math_symbol_table.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
symbols = [
23
["Lower-case Greek",
34
5,
@@ -141,7 +142,7 @@ def setup(app):
141142
# Do some verification of the tables
142143
from matplotlib import _mathtext_data
143144

144-
print "SYMBOLS NOT IN STIX:"
145+
print("SYMBOLS NOT IN STIX:")
145146
all_symbols = {}
146147
for category, columns, syms in symbols:
147148
if category == "Standard Function Names":
@@ -151,9 +152,9 @@ def setup(app):
151152
if len(sym) > 1:
152153
all_symbols[sym[1:]] = None
153154
if sym[1:] not in _mathtext_data.tex2uni:
154-
print sym
155+
print(sym)
155156

156-
print "SYMBOLS NOT IN TABLE:"
157+
print("SYMBOLS NOT IN TABLE:")
157158
for sym in _mathtext_data.tex2uni:
158159
if sym not in all_symbols:
159-
print sym
160+
print(sym)

doc/utils/pylab_names.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
"""
23
autogenerate some tables for pylab namespace
34
"""
@@ -14,7 +15,7 @@
1415
doc = getattr(o, '__doc__', None)
1516
if doc is not None:
1617
doc = ' - '.join([line for line in doc.split('\n') if line.strip()][:2])
17-
18+
1819
mod = getattr(o, '__module__', None)
1920
if mod is None:
2021
mod = 'unknown'
@@ -25,7 +26,7 @@
2526
k = ':class:`~%s.%s`'%(mod, k)
2627
else:
2728
k = ':func:`~%s.%s`'%(mod, k)
28-
mod = ':mod:`%s`'%mod
29+
mod = ':mod:`%s`'%mod
2930
elif mod.startswith('numpy'):
3031
#k = '`%s <%s>`_'%(k, 'http://scipy.org/Numpy_Example_List_With_Doc#%s'%k)
3132
k = '`%s <%s>`_'%(k, 'http://sd-2116.dedibox.fr/pydocweb/doc/%s.%s'%(mod, k))
@@ -40,21 +41,21 @@
4041
mods.sort()
4142
for mod in mods:
4243
border = '*'*len(mod)
43-
print mod
44-
print border
44+
print(mod)
45+
print(border)
4546

46-
print
47+
print()
4748
funcs, docs = zip(*modd[mod])
4849
maxfunc = max([len(f) for f in funcs])
4950
maxdoc = max(40, max([len(d) for d in docs]) )
5051
border = ' '.join(['='*maxfunc, '='*maxdoc])
51-
print border
52-
print ' '.join(['symbol'.ljust(maxfunc), 'description'.ljust(maxdoc)])
53-
print border
52+
print(border)
53+
print(' '.join(['symbol'.ljust(maxfunc), 'description'.ljust(maxdoc)]))
54+
print(border)
5455
for func, doc in modd[mod]:
5556
row = ' '.join([func.ljust(maxfunc), doc.ljust(maxfunc)])
56-
print row
57+
print(row)
5758

58-
print border
59-
print
59+
print(border)
60+
print()
6061
#break

examples/animation/old_animation/animate_decay_tk_blit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
import time, sys
23
import numpy as np
34
import matplotlib.pyplot as plt
@@ -44,7 +45,7 @@ def run(*args):
4445

4546
if run.cnt==1000:
4647
# print the timing info and quit
47-
print 'FPS:' , 1000/(time.time()-tstart)
48+
print('FPS:' , 1000/(time.time()-tstart))
4849
sys.exit()
4950

5051
run.cnt += 1

examples/animation/old_animation/animation_blit_fltk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
import sys
23
import fltk
34
import matplotlib
@@ -37,7 +38,7 @@ def update(self,ptr):
3738
self.cnt+=1
3839
if self.cnt==1000:
3940
# print the timing info and quit
40-
print 'FPS:' , 1000/(time.time()-self.tstart)
41+
print('FPS:' , 1000/(time.time()-self.tstart))
4142
sys.exit()
4243
return True
4344

examples/animation/old_animation/animation_blit_gtk.py

100644100755
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22

3+
from __future__ import print_function
4+
35
# For detailed comments on animation and the techniques used here, see
46
# the wiki entry
57
# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
@@ -30,7 +32,7 @@
3032
tstart = time.time()
3133

3234
def update_line(*args):
33-
print 'you are here', update_line.cnt
35+
print('you are here', update_line.cnt)
3436
if update_line.background is None:
3537
update_line.background = canvas.copy_from_bbox(ax.bbox)
3638

@@ -46,7 +48,7 @@ def update_line(*args):
4648

4749
if update_line.cnt==1000:
4850
# print the timing info and quit
49-
print 'FPS:' , 1000/(time.time()-tstart)
51+
print('FPS:' , 1000/(time.time()-tstart))
5052
gtk.mainquit()
5153
raise SystemExit
5254

examples/animation/old_animation/animation_blit_gtk2.py

100644100755
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22

3+
from __future__ import print_function
4+
35
"""
46
This example utlizes restore_region with optional bbox and xy
57
arguments. The plot is continuously shifted to the left. Instead of
@@ -137,7 +139,7 @@ def update_line(self, *args):
137139
dt = (time.time()-tstart)
138140
if dt>15:
139141
# print the timing info and quit
140-
print 'FPS:' , self.cnt/dt
142+
print('FPS:' , self.cnt/dt)
141143
gtk.main_quit()
142144
raise SystemExit
143145

examples/animation/old_animation/animation_blit_qt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# For detailed comments on animation and the techniqes used here, see
22
# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
33

4+
from __future__ import print_function
5+
46
import os, sys
57
import matplotlib
68
matplotlib.use('QtAgg') # qt3 example
@@ -47,7 +49,7 @@ def timerEvent(self, evt):
4749

4850
if self.cnt==ITERS:
4951
# print the timing info and quit
50-
print 'FPS:' , ITERS/(time.time()-self.tstart)
52+
print('FPS:', ITERS/(time.time()-self.tstart))
5153
sys.exit()
5254

5355
else:

0 commit comments

Comments
 (0)