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

Skip to content

The MEGA Python 3.x branch merge #565

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 153 commits into from
Nov 9, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
cec3212
C/C++ compiling (not necessarily working) with Py3K
mdboom Jul 14, 2010
5336b98
Convert uses of the builtin file() to the builtin open(). Calls to fi…
dopplershift Jul 15, 2010
9e2805a
Fix import from _path and combine with other existing (working) import.
dopplershift Jul 15, 2010
192f67e
Fix compilation in Python 2.x
mdboom Jul 15, 2010
acbe206
Able to produce simple_plot.py!!!
mdboom Jul 16, 2010
1bcfeac
Make TkAgg backend compile and work.
astropy-buildbot Feb 22, 2011
b90e18b
Update for new signature of MethodType in Python 3.1 (Let's assume Py…
astropy-buildbot Feb 22, 2011
654e1fd
Consistent way of handling version checks.
astropy-buildbot Feb 22, 2011
d2ebfab
Remove debugging detritus.
astropy-buildbot Feb 22, 2011
78ed16a
Fix mistake in last commit -- still getting my git legs.
astropy-buildbot Feb 22, 2011
81219db
Consistent use of PY3K #define everywhere.
astropy-buildbot Feb 22, 2011
0f58de4
First pass at getting Qt4Agg backend working.
astropy-buildbot Feb 22, 2011
13c93fb
First pass at SVG backend.
astropy-buildbot Feb 22, 2011
ba5610f
Fix font manager so it doesn't miss some fonts whose attributes don't…
astropy-buildbot Feb 22, 2011
4df3275
First pass at PDF backend.
astropy-buildbot Feb 22, 2011
7f4f644
Fix TkAgg backend on Python 2.x
astropy-buildbot Feb 22, 2011
7fdae0a
First pass at PS backend.
astropy-buildbot Feb 22, 2011
ef7f818
Fix PS backend for Python 2.x
astropy-buildbot Feb 22, 2011
1b03d30
First time passing "mathtext demo"
astropy-buildbot Feb 22, 2011
ac0cf85
Fix Python 2.x build
astropy-buildbot Feb 22, 2011
df12d4e
Get mathtext working on Python 2.x. Must ship two versions of pypars…
astropy-buildbot Feb 23, 2011
0167aa6
First pass at usetex support.
astropy-buildbot Feb 23, 2011
016cba4
Use more modern io module in SVG backend.
astropy-buildbot Feb 23, 2011
31a428c
Initial progress on Agg buffer support.
mdboom Feb 24, 2011
503367f
Backporting lots of Python 2.x-safe changes based on the output of 2to3.
mdboom Feb 25, 2011
a74a66d
Add missing print function conversion.
mdboom Feb 25, 2011
af0f269
Revert some changes to PDF Type 3 generation to make text placement e…
mdboom Feb 25, 2011
381ae70
Import izip where necessary
mdboom Feb 25, 2011
4cdfa69
Basic changes to make regression tests run under Python 3.x
mdboom Feb 25, 2011
75b1d10
Forgot another print function change.
mdboom Feb 25, 2011
db25391
A few minor changes to get the regression tests working in Python 2.7
mdboom Feb 25, 2011
eaab4c7
Get regression test framework working under Python 3.x by removing th…
mdboom Feb 28, 2011
05243f9
Fix a number of common bugs revealed by the regression tests.
mdboom Feb 28, 2011
8879aef
Update PyCXX to 6.2.2.
astropy-buildbot Mar 2, 2011
4715685
Update FT2Font to use the "new" extension API in CXX
astropy-buildbot Mar 2, 2011
3878f85
Further (incomplete) progress
astropy-buildbot Mar 3, 2011
86a34ca
Update PyCXX to 6.2.2 and remove dependency on PyCObject
mdboom Mar 3, 2011
0d78abb
Remove extraneous debugging statements
mdboom Mar 3, 2011
8ba1981
Move FT2Font to new PyCXX extension type API
mdboom Mar 3, 2011
148025b
Various minor cleanups to FT2Font
mdboom Mar 3, 2011
0683fe0
another fix of setupext.py to use tkinter for py3
leejjoon Mar 4, 2011
d767dde
convert the output of subprocess.Popen to string
leejjoon Mar 4, 2011
c16b431
fix Axes.hist that uses *range* keyword argument, causing an error af…
leejjoon Mar 4, 2011
d0e975d
axes_grid : replace new.classobj w/ type
leejjoon Mar 4, 2011
094a4ab
Fix mathtext regression tests
mdboom Mar 8, 2011
590992e
Remove the as_rgb and as_rgba methods from FT2Image, as they are no l…
mdboom Mar 8, 2011
5a4c578
Simplify mathtext code so it doesn't require cyclical/weak references…
mdboom Mar 8, 2011
26ea232
Fix memory leak in ft2font/mathtext.
mdboom Mar 10, 2011
37a7aa6
Fix memory leak in ft2font/mathtext.
mdboom Mar 10, 2011
86b1703
Fixing use case where no font property is provided
mdboom Mar 10, 2011
57d3a12
Fix a pyparsing-related memory leak.
mdboom Mar 10, 2011
4311dc8
Don't convert pyparsing_py3 through 2to3
mdboom Mar 10, 2011
a4034a2
Fix pyparsing memory leaks on Python 3.x.
mdboom Mar 11, 2011
5f3c7db
Remove ridiculous workaround.
mdboom Mar 11, 2011
621c4bb
Re-enable the mathtext expression cache for Python 3.x, now that the …
mdboom Mar 11, 2011
2f2ae95
Merge branch 'ft2font_memleak' of https://github.com/mdboom/matplotli…
mdboom Mar 11, 2011
d7132eb
Don't create exception objects unless absolutely necessary -- they ar…
mdboom Mar 11, 2011
341c568
print_function transition in examples
mdboom Mar 11, 2011
2bc5b5e
Use print_function in docs subdirectory
mdboom Mar 11, 2011
0140f32
make embedding_in_qt4.py work with python-3
ddale Mar 14, 2011
a24cae5
Merge branch 'simplify_exceptions' of git://github.com/mdboom/matplot…
ddale Mar 14, 2011
b166ccb
Miscellaneous fixes submitted by Christoph Gohlke in the mailing list…
mdboom Mar 11, 2011
97d7daf
Update to use print_function in all library Python files -- whether t…
mdboom Mar 14, 2011
a32eb4e
More miscellaneous print_function updates.
mdboom Mar 14, 2011
0bb0ecb
Use "from __future__ import unicode_literals" where necessary.
mdboom Mar 14, 2011
422c13e
Miscellaneous fixes to get examples running under Python 3.x
cgohlke Mar 14, 2011
c433150
Merge branch 'print_function' of git://github.com/mdboom/matplotlib-p…
ddale Mar 14, 2011
fa54b6b
Merge branch 'unicode_literals' of git://github.com/mdboom/matplotlib…
ddale Mar 14, 2011
9891e70
Merge branch 'examples' of git://github.com/mdboom/matplotlib-py3 int…
ddale Mar 14, 2011
de73269
improve __future__ imports in backend_driver.py
ddale Mar 14, 2011
a800631
backend_driver uses current python to execute scripts
ddale Mar 14, 2011
03f0cbc
backend_driver is more selective with unicode_literals
ddale Mar 14, 2011
2dfbd1b
fix a mathtext rendering bug
mdboom Mar 14, 2011
2ae4fcc
Protect against gcc's "invalid use of 'static' in linkage specificati…
Mar 15, 2011
9648c48
Merge remote branch 'remotes/main/master' (matplotlib/matplotlib/master)
mdboom Mar 16, 2011
fe94aff
Minor fixes from last commit.
mdboom Mar 16, 2011
17fafc0
Run 2to3 conversions in parallel on multicore machines.
mdboom Mar 16, 2011
77a6f9e
test_simplification: Remove noisy print statements.
stefanv Mar 5, 2011
5af0f20
compare: Use same histogram bins for all comparisons.
stefanv Mar 5, 2011
9db64a8
Always use floating point division in image comparison (this fixes co…
stefanv Mar 5, 2011
c40a624
Replaced try-except-else with try-finally
gpoulter Mar 5, 2011
67427c3
Explicitly set mode of temporary file passed to CSV writer to non-bin…
hodgestar Mar 5, 2011
b144485
test_simplification: Correctly decode base64 under py3k.
stefanv Mar 5, 2011
5fcec51
Fix render_pdf check_simple_chunks test to work with py3k
Mar 5, 2011
07460d8
Avoid using list comprehension variable after the fact, Py3 scopes it…
gpoulter Mar 5, 2011
8d4fd96
Changed str to unicode+decode
gpoulter Mar 5, 2011
19d5029
Use base64.encodestring under Python 2.x and keep base64.encodebytes …
hodgestar Mar 5, 2011
a6b449c
Deterministically initialising recarray because uninitialised memory …
gpoulter Mar 5, 2011
cd34b7b
Note that known failing tests plugin is only loaded when testing via …
gpoulter Mar 5, 2011
2962c8d
Move __future__ imports earlier to avoid 'from __future__ imports mus…
Mar 16, 2011
1969adc
Adding TODO: note about the lazy-loading not working from the compare…
gpoulter Mar 5, 2011
90e0fac
_png: Avoid decoding byte buffers.
stefanv Mar 5, 2011
d0a0519
Update imread docstring: input file must be opened in binary mode.
stefanv Mar 5, 2011
3fd83a6
Merge branch 'test_fixes' of https://github.com/CTPUG/matplotlib-py3 …
mdboom Mar 17, 2011
05745e9
Merge branch 'py3k-fixes' of https://github.com/CTPUG/matplotlib-py3 …
mdboom Mar 17, 2011
4ce5aec
Miscellaneous fixes to the examples to make them run on both Python 3…
cgohlke Mar 17, 2011
25b6910
Use PyMODINIT_FUNC where appropriate.
cgohlke Mar 17, 2011
f22f485
Merge branch 'cgohlke_misc' of https://github.com/mdboom/matplotlib-p…
astropy-buildbot Mar 21, 2011
98ee4e9
Fix reference counting bug that was causing a memory leak in test_mat…
astropy-buildbot Mar 22, 2011
85f9411
Bug in how supported filetypes are found.
astropy-buildbot Mar 23, 2011
f6e2a89
Merge branch 'find_filetypes' of https://github.com/mdboom/matplotlib…
astropy-buildbot Mar 23, 2011
85af0c0
Merge branch 'ob_refcnt' of https://github.com/mdboom/matplotlib-py3 …
astropy-buildbot Mar 23, 2011
9046990
Merge remote-tracking branch 'remotes/main/master'
astropy-buildbot Mar 23, 2011
2c67fb2
Updated CXX, fixes ~300MB of memory leaks in tests
ivanov Mar 23, 2011
749f295
Updated CXX, fixes ~300MB of memory leaks in tests
ivanov Mar 23, 2011
f4fee35
Support the new Python 3 buffer interface to get the Agg renderer buf…
astropy-buildbot Mar 23, 2011
9b0cfda
don't use multiprocessing to convert files on win
ddale Mar 31, 2011
64471cf
Merge remote branch 'main/master'
mdboom Apr 4, 2011
4a28a0e
Merge branch 'master', remote branch 'upstream/master'
mdboom Apr 4, 2011
ea37f62
Merge remote branch 'main/master'
mdboom Apr 8, 2011
b2f4e1f
Fixes a segfault caused by incorrect use of new Python buffer interfa…
mdboom Apr 11, 2011
b2109bb
Merge branch 'fix_segfault' of https://github.com/mdboom/matplotlib-p…
mdboom Apr 11, 2011
f1388ee
Merge branch 'win_no_multiprocessing' of https://github.com/ddale/mat…
mdboom Apr 11, 2011
a654956
Changed version display of Tkinter
misayre Apr 12, 2011
08866f1
Removed import new
misayre Apr 12, 2011
d0bb126
Rewritten listFiles in cbook.py to work on Py3k
misayre Apr 12, 2011
f3798db
Merge branch 'master', remote branch 'upstream/master'
mdboom Apr 12, 2011
d525df5
Merge branch 'master', remote branch 'upstream/master'
mdboom Apr 12, 2011
3b9b105
Fix test_mathtext so it passes by lowering comparison threshold to th…
mdboom Apr 12, 2011
b8f2edc
Merged 'master'
mdboom Apr 12, 2011
283abca
Merged 'main/master'
mdboom Apr 15, 2011
1df7e17
Merge branch 'master', remote branch 'main/master'
mdboom Apr 15, 2011
8e78ef6
Fix memory leak in CXX that was accidentally written over when updati…
mdboom Apr 19, 2011
267c3cb
Merged matplotlib/matplotlib/master
mdboom May 5, 2011
f2d8547
Merge remote-tracking branch 'main/master'
mdboom Jun 13, 2011
0adb05e
Minor fix for Python 2.x compatibility.
mdboom Jun 13, 2011
d1e3b1c
Flush buffer when finishing SVG file. Closes #30.
mdboom Jun 28, 2011
e06cef0
Merge pull request #31 from mdboom/bytes_io_truncated
mdboom Jun 28, 2011
755949b
Merge remote-tracking branch 'main/master'
mdboom Jun 28, 2011
09de6ad
Merge branch 'master' of github.com:matplotlib/matplotlib-py3
mdboom Jun 28, 2011
786bab9
Merged from main/master
mdboom Aug 25, 2011
4cb2aaa
Be more careful about closing files, since the gc doesn't always clos…
mdboom Aug 25, 2011
1f074a8
Python 3.x fixes in new generic marker code.
mdboom Aug 25, 2011
ab078c9
Disable test_symlog2 -- it consumes unbounded amounts of RAM on Pytho…
mdboom Aug 25, 2011
6c8bf3b
Remove image comparisons for figure_today -- redundant.
mdboom Aug 25, 2011
a4f5fa5
Fix Python 3.x build -- Tkinter -> tkinter
mdboom Aug 25, 2011
927acf8
Fix bbox_inches="tight" in Python 3.x
mdboom Aug 25, 2011
6a735e2
Fix error reporting in png extension.
mdboom Aug 25, 2011
cedc5ad
Use integer division to make the tests pass on Python3
mdboom Aug 29, 2011
cafa53c
Merge remote-tracking branch 'main/master'
mdboom Oct 28, 2011
6261ad1
Make tests work again.
mdboom Oct 28, 2011
677f9cc
Merge remote-tracking branch 'py3-main/master' into py3-merge
mdboom Oct 31, 2011
e247424
Fix TypeError: __bool__ should return bool, returned int in python3. …
jenshnielsen Nov 3, 2011
d5ff72a
Merge pull request #5 from jenshnielsen/py3test
mdboom Nov 4, 2011
287b814
fix print statements in backend_qt.py and backend_qt4.py
leejjoon Nov 4, 2011
39f05e8
Merge pull request #6 from leejjoon/py3-print-fix-backend-qt
mdboom Nov 4, 2011
6c83a15
Fix upside-down non-scaled image problem in SVG.
mdboom Nov 4, 2011
6805ed7
Add warnings when using Wx or Gtk backend under Python 3.x
mdboom Nov 4, 2011
62cca9d
Updating test_imshow -- the text seems to throw off the matching and …
mdboom Nov 4, 2011
7698e6a
Update pngsuite baseline image to take into account new proper handli…
mdboom Nov 4, 2011
c2576db
Update test_tightlayout5 baseline image to match new unscaled image s…
mdboom Nov 4, 2011
3dbdca0
update make_tex and make_tex_preview in texmanager.py to work on Py3k
leejjoon Nov 7, 2011
08fbcdc
Merge pull request #7 from leejjoon/py3-update-texmanager
mdboom Nov 8, 2011
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
8 changes: 4 additions & 4 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ Next, we need to get matplotlib installed. We provide prebuilt
binaries for OS X and Windows on the matplotlib `download
<http://sourceforge.net/projects/matplotlib/files/>`_ page. Click on
the latest release of the "matplotlib" package, choose your python
version (e.g., 2.6 or 2.7) and your platform (macosx or win32).
If you have any problems, please check the :ref:`installing-faq`,
search using Google, and/or post a question to the `mailing list
version (2.6, 2.7 or 3.2) and your platform (macosx or win32). If you
have any problems, please check the :ref:`installing-faq`, search
using Google, and/or post a question the `mailing list
<http://sourceforge.net/project/showfiles.php?group_id=80706>`_.

If you are on Debian/Ubuntu Linux, it suffices to do::
If you are on Debian/Ubuntu linux, it suffices to do::

> sudo apt-get install python-matplotlib

Expand Down
9 changes: 4 additions & 5 deletions doc/devel/coding_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,7 @@ Requirements

The following software is required to run the tests:

- nose_, version 0.11.1 or later

- `Python Imaging Library
<http://www.pythonware.com/products/pil/>`_ (to compare image
results)
- nose_, version 1.0 or later

- `Ghostscript <http://pages.cs.wisc.edu/~ghost/>`_ (to render PDF
files)
Expand Down Expand Up @@ -405,6 +401,9 @@ arguments works from within Python::
.. _`nosetest arguments`: http://somethingaboutorange.com/mrl/projects/nose/1.0.0/usage.html


Running tests by any means other than `matplotlib.test()`
does not load the nose "knownfailureif" (Known failing tests) plugin,
causing known-failing tests to fail for real.

Writing a simple test
---------------------
Expand Down
4 changes: 3 additions & 1 deletion doc/make.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python

from __future__ import print_function
import fileinput
import glob
import os
Expand Down Expand Up @@ -169,7 +171,7 @@ def latex():

os.chdir('../..')
else:
print 'latex build has not been tested on windows'
print('latex build has not been tested on windows')

def clean():
shutil.rmtree("build", ignore_errors=True)
Expand Down
75 changes: 75 additions & 0 deletions doc/pyplots/make.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/usr/bin/env python

from __future__ import print_function
import sys, os, glob
import matplotlib
import IPython.Shell
#matplotlib.rcdefaults()
matplotlib.use('Agg')

mplshell = IPython.Shell.MatplotlibShell('mpl')

formats = [('png', 100),
('hires.png', 200),
('pdf', 72)]

def figs():
print('making figs')
import matplotlib.pyplot as plt
for fname in glob.glob('*.py'):
if fname.split('/')[-1] == __file__.split('/')[-1]: continue
basename, ext = os.path.splitext(fname)
imagefiles = dict([('%s.%s'%(basename, format), dpi)
for format, dpi in formats])
all_exists = True
for imagefile in imagefiles:
if not os.path.exists(imagefile):
all_exists = False
break

if all_exists:
print(' already have %s'%fname)
else:
print(' building %s'%fname)
plt.close('all') # we need to clear between runs
mplshell.magic_run(basename)
for imagefile, dpi in imagefiles.iteritems():
# todo: this will get called even if the run script
# fails and exits, thus creating a stub pdf and png
# iles preventing them from getting built successfully
# later
plt.savefig(imagefile, dpi=dpi)
print('all figures made')


def clean():
patterns = (['#*', '*~', '*pyc'] +
['*.%s' % format for format, dpi in formats])
for pattern in patterns:
for fname in glob.glob(pattern):
os.remove(fname)
print('all clean')



def all():
figs()

funcd = {'figs':figs,
'clean':clean,
'all':all,
}

if len(sys.argv)>1:
for arg in sys.argv[1:]:
func = funcd.get(arg)
if func is None:
raise SystemExit('Do not know how to handle %s; valid args are'%(
arg, funcd.keys()))
func()
else:
all()




3 changes: 2 additions & 1 deletion doc/sphinxext/gen_rst.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
generate the rst files for the examples by iterating over the pylab examples
"""
from __future__ import print_function
import os, glob

import os
Expand Down Expand Up @@ -152,7 +153,7 @@ def generate_example_rst(app):

fhindex.close()

print
print()

def setup(app):
app.connect('builder-inited', generate_example_rst)
9 changes: 5 additions & 4 deletions doc/sphinxext/math_symbol_table.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
symbols = [
["Lower-case Greek",
5,
Expand Down Expand Up @@ -141,7 +142,7 @@ def setup(app):
# Do some verification of the tables
from matplotlib import _mathtext_data

print "SYMBOLS NOT IN STIX:"
print("SYMBOLS NOT IN STIX:")
all_symbols = {}
for category, columns, syms in symbols:
if category == "Standard Function Names":
Expand All @@ -151,9 +152,9 @@ def setup(app):
if len(sym) > 1:
all_symbols[sym[1:]] = None
if sym[1:] not in _mathtext_data.tex2uni:
print sym
print(sym)

print "SYMBOLS NOT IN TABLE:"
print("SYMBOLS NOT IN TABLE:")
for sym in _mathtext_data.tex2uni:
if sym not in all_symbols:
print sym
print(sym)
23 changes: 12 additions & 11 deletions doc/utils/pylab_names.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
"""
autogenerate some tables for pylab namespace
"""
Expand All @@ -14,7 +15,7 @@
doc = getattr(o, '__doc__', None)
if doc is not None:
doc = ' - '.join([line for line in doc.split('\n') if line.strip()][:2])

mod = getattr(o, '__module__', None)
if mod is None:
mod = 'unknown'
Expand All @@ -25,7 +26,7 @@
k = ':class:`~%s.%s`'%(mod, k)
else:
k = ':func:`~%s.%s`'%(mod, k)
mod = ':mod:`%s`'%mod
mod = ':mod:`%s`'%mod
elif mod.startswith('numpy'):
#k = '`%s <%s>`_'%(k, 'http://scipy.org/Numpy_Example_List_With_Doc#%s'%k)
k = '`%s <%s>`_'%(k, 'http://sd-2116.dedibox.fr/pydocweb/doc/%s.%s'%(mod, k))
Expand All @@ -40,21 +41,21 @@
mods.sort()
for mod in mods:
border = '*'*len(mod)
print mod
print border
print(mod)
print(border)

print
print()
funcs, docs = zip(*modd[mod])
maxfunc = max([len(f) for f in funcs])
maxdoc = max(40, max([len(d) for d in docs]) )
border = ' '.join(['='*maxfunc, '='*maxdoc])
print border
print ' '.join(['symbol'.ljust(maxfunc), 'description'.ljust(maxdoc)])
print border
print(border)
print(' '.join(['symbol'.ljust(maxfunc), 'description'.ljust(maxdoc)]))
print(border)
for func, doc in modd[mod]:
row = ' '.join([func.ljust(maxfunc), doc.ljust(maxfunc)])
print row
print(row)

print border
print
print(border)
print()
#break
3 changes: 2 additions & 1 deletion examples/animation/old_animation/animate_decay_tk_blit.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import time, sys
import numpy as np
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -44,7 +45,7 @@ def run(*args):

if run.cnt==1000:
# print the timing info and quit
print 'FPS:' , 1000/(time.time()-tstart)
print('FPS:' , 1000/(time.time()-tstart))
sys.exit()

run.cnt += 1
Expand Down
3 changes: 2 additions & 1 deletion examples/animation/old_animation/animation_blit_fltk.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import sys
import fltk
import matplotlib
Expand Down Expand Up @@ -37,7 +38,7 @@ def update(self,ptr):
self.cnt+=1
if self.cnt==1000:
# print the timing info and quit
print 'FPS:' , 1000/(time.time()-self.tstart)
print('FPS:' , 1000/(time.time()-self.tstart))
sys.exit()
return True

Expand Down
6 changes: 4 additions & 2 deletions examples/animation/old_animation/animation_blit_gtk.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python

from __future__ import print_function

# For detailed comments on animation and the techniques used here, see
# the wiki entry
# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
Expand Down Expand Up @@ -30,7 +32,7 @@
tstart = time.time()

def update_line(*args):
print 'you are here', update_line.cnt
print('you are here', update_line.cnt)
if update_line.background is None:
update_line.background = canvas.copy_from_bbox(ax.bbox)

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

if update_line.cnt==1000:
# print the timing info and quit
print 'FPS:' , 1000/(time.time()-tstart)
print('FPS:' , 1000/(time.time()-tstart))
gtk.mainquit()
raise SystemExit

Expand Down
4 changes: 3 additions & 1 deletion examples/animation/old_animation/animation_blit_gtk2.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python

from __future__ import print_function

"""
This example utlizes restore_region with optional bbox and xy
arguments. The plot is continuously shifted to the left. Instead of
Expand Down Expand Up @@ -137,7 +139,7 @@ def update_line(self, *args):
dt = (time.time()-tstart)
if dt>15:
# print the timing info and quit
print 'FPS:' , self.cnt/dt
print('FPS:' , self.cnt/dt)
gtk.main_quit()
raise SystemExit

Expand Down
4 changes: 3 additions & 1 deletion examples/animation/old_animation/animation_blit_qt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# For detailed comments on animation and the techniqes used here, see
# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations

from __future__ import print_function

import os, sys
import matplotlib
matplotlib.use('QtAgg') # qt3 example
Expand Down Expand Up @@ -47,7 +49,7 @@ def timerEvent(self, evt):

if self.cnt==ITERS:
# print the timing info and quit
print 'FPS:' , ITERS/(time.time()-self.tstart)
print('FPS:', ITERS/(time.time()-self.tstart))
sys.exit()

else:
Expand Down
4 changes: 3 additions & 1 deletion examples/animation/old_animation/animation_blit_qt4.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# For detailed comments on animation and the techniqes used here, see
# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations

from __future__ import print_function

import os
import sys

Expand Down Expand Up @@ -63,7 +65,7 @@ def timerEvent(self, evt):
self.draw()
if self.cnt==ITERS:
# print the timing info and quit
print 'FPS:' , ITERS/(time.time()-self.tstart)
print('FPS:' , ITERS/(time.time()-self.tstart))
sys.exit()
else:
self.cnt += 1
Expand Down
4 changes: 3 additions & 1 deletion examples/animation/old_animation/animation_blit_tk.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# For detailed comments on animation and the techniqes used here, see
# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations

from __future__ import print_function

import matplotlib
matplotlib.use('TkAgg')

Expand Down Expand Up @@ -34,7 +36,7 @@ def run(*args):

if run.cnt==1000:
# print the timing info and quit
print 'FPS:' , 1000/(time.time()-tstart)
print('FPS:', 1000/(time.time()-tstart))
sys.exit()

run.cnt += 1
Expand Down
12 changes: 7 additions & 5 deletions examples/animation/old_animation/animation_blit_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# the wiki entry
# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation

from __future__ import print_function

# The number of blits() to make before exiting
NBLITS = 1000

Expand Down Expand Up @@ -58,11 +60,11 @@ def update_line(*args):
if update_line.cnt == NBLITS:
# print the timing info and quit
frame_time = time.time() - tstart
print '%d frames: %.2f seconds' % (NBLITS, frame_time)
print '%d blits: %.2f seconds' % (NBLITS, blit_time)
print
print 'FPS: %.2f' % (NBLITS/frame_time)
print 'BPS: %.2f' % (NBLITS/blit_time)
print('%d frames: %.2f seconds' % (NBLITS, frame_time))
print('%d blits: %.2f seconds' % (NBLITS, blit_time))
print()
print('FPS: %.2f' % (NBLITS/frame_time))
print('BPS: %.2f' % (NBLITS/blit_time))
sys.exit()

update_line.cnt += 1
Expand Down
4 changes: 3 additions & 1 deletion examples/animation/old_animation/dynamic_image_gtkagg.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python

from __future__ import print_function
"""
An animated image
"""
Expand Down Expand Up @@ -34,7 +36,7 @@ def updatefig(*args):
manager.canvas.draw()
cnt += 1
if cnt==50:
print 'FPS', cnt/(time.time() - tstart)
print('FPS', cnt/(time.time() - tstart))
return False
return True

Expand Down
Loading