You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jd...@us...> - 2008-05-17 22:05:57
|
Revision: 5186
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5186&view=rev
Author: jdh2358
Date: 2008-05-17 15:05:52 -0700 (Sat, 17 May 2008)
Log Message:
-----------
fixed backend driver cleanup
Modified Paths:
--------------
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 21:57:19 UTC (rev 5185)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 22:05:52 UTC (rev 5186)
@@ -209,12 +209,14 @@
localdirs = [d for d in glob.glob('*') if os.path.isdir(d)]
all_backends_set = set(all_backends)
for d in localdirs:
- if d.lower() in all_backends_set:
- command = 'rm -rf %s'%d
- # todo: implement python recursive remove
- print 'executing: %s'%command
- os.system(command)
- os.system('rm -rf _tmp*.py')
+ if d.lower() not in all_backends_set: continue
+ print 'removing %s'%d
+ for fname in glob.glob(os.path.join(d, '*')):
+ os.remove(fname)
+ os.rmdir(d)
+ for fname in glob.glob('_tmp*.py'):
+ os.remove(fname)
+
print 'all clean...'
raise SystemExit
if '--coverage' in sys.argv:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:58:05
|
Revision: 5185
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5185&view=rev
Author: jdh2358
Date: 2008-05-17 14:57:19 -0700 (Sat, 17 May 2008)
Log Message:
-----------
fixed backend driver cleanup
Modified Paths:
--------------
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 21:54:14 UTC (rev 5184)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 21:57:19 UTC (rev 5185)
@@ -19,6 +19,9 @@
import os, time, sys, glob
import matplotlib.backends as mplbe
+all_backends = [b.lower() for b in mplbe.all_backends]
+all_backends.extend(['cairo.png', 'cairo.ps', 'cairo.pdf', 'cairo.svg'])
+
pylab_dir = os.path.join('..', 'pylab')
pylab_files = [
'alignment_test.py',
@@ -204,9 +207,9 @@
default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template']
if len(sys.argv)==2 and sys.argv[1]=='--clean':
localdirs = [d for d in glob.glob('*') if os.path.isdir(d)]
- backends_lower = set([b.lower() for b in default_backends])
+ all_backends_set = set(all_backends)
for d in localdirs:
- if d.lower() in backends_lower:
+ if d.lower() in all_backends_set:
command = 'rm -rf %s'%d
# todo: implement python recursive remove
print 'executing: %s'%command
@@ -225,8 +228,6 @@
python = [r'c:\Python24\python.exe']
else:
python = ['python']
- all_backends = [b.lower() for b in mplbe.all_backends]
- all_backends.extend(['cairo.png', 'cairo.ps', 'cairo.pdf', 'cairo.svg'])
backends = []
switches = []
if sys.argv[1:]:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:54:17
|
Revision: 5184
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5184&view=rev
Author: jdh2358
Date: 2008-05-17 14:54:14 -0700 (Sat, 17 May 2008)
Log Message:
-----------
fixed backend driver cleanup
Modified Paths:
--------------
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 21:47:40 UTC (rev 5183)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 21:54:14 UTC (rev 5184)
@@ -16,7 +16,7 @@
"""
from __future__ import division
-import os, time, sys
+import os, time, sys, glob
import matplotlib.backends as mplbe
pylab_dir = os.path.join('..', 'pylab')
@@ -203,10 +203,15 @@
times = {}
default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template']
if len(sys.argv)==2 and sys.argv[1]=='--clean':
- for b in default_backends:
- # todo: implement python recursive remove
- print 'executing: %s'%command
- os.system(command)
+ localdirs = [d for d in glob.glob('*') if os.path.isdir(d)]
+ backends_lower = set([b.lower() for b in default_backends])
+ for d in localdirs:
+ if d.lower() in backends_lower:
+ command = 'rm -rf %s'%d
+ # todo: implement python recursive remove
+ print 'executing: %s'%command
+ os.system(command)
+ os.system('rm -rf _tmp*.py')
print 'all clean...'
raise SystemExit
if '--coverage' in sys.argv:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:47:44
|
Revision: 5183
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5183&view=rev
Author: jdh2358
Date: 2008-05-17 14:47:40 -0700 (Sat, 17 May 2008)
Log Message:
-----------
fixed backend driver cleanup
Modified Paths:
--------------
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 21:39:46 UTC (rev 5182)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-05-17 21:47:40 UTC (rev 5183)
@@ -205,9 +205,10 @@
if len(sys.argv)==2 and sys.argv[1]=='--clean':
for b in default_backends:
# todo: implement python recursive remove
- os.system('rm -rf %s'%b)
- print 'all clean...'
- raise SystemExit
+ print 'executing: %s'%command
+ os.system(command)
+ print 'all clean...'
+ raise SystemExit
if '--coverage' in sys.argv:
python = ['coverage.py', '-x']
sys.argv.remove('--coverage')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:39:52
|
Revision: 5182
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5182&view=rev
Author: jdh2358
Date: 2008-05-17 14:39:46 -0700 (Sat, 17 May 2008)
Log Message:
-----------
Merged revisions 5181 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r5181 | jdh2358 | 2008-05-17 16:38:21 -0500 (Sat, 17 May 2008) | 1 line
fixed some typos in the CODING_GUIDE
........
Modified Paths:
--------------
trunk/matplotlib/CODING_GUIDE
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4816,5172,5178-5179
+ /branches/v0_91_maint:1-4816,5172,5178-5179,5181
Modified: trunk/matplotlib/CODING_GUIDE
===================================================================
--- trunk/matplotlib/CODING_GUIDE 2008-05-17 21:38:21 UTC (rev 5181)
+++ trunk/matplotlib/CODING_GUIDE 2008-05-17 21:39:46 UTC (rev 5182)
@@ -41,11 +41,13 @@
MANIFEST.in. This file determines what goes into the src
distribution of the mpl build.
- * Keep the maintenance branch and trunk in sync here it makes sense.
+ * Keep the maintenance branch and trunk in sync where it makes sense.
If there is a bug on both that needs fixing, use svnmerge.py to
- fix them. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
+ keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
basic procedure is:
+ - install svnmerge.py in your PATH
+
- get a svn copy of the branch (svn co
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint)
and the trunk (svn co
@@ -55,8 +57,9 @@
it. Make sure you svn upped on the trunk and have no local
modifications, and then from the svn trunk do
- # where these are the revision numbers. ranges also acceptable
+ # where the NNN are the revision numbers. ranges also acceptable
> svnmerge.py merge -rNNN1,NNN2
+
# this file is automatically created by the merge command
> svn commit -F svnmerge-commit-message.txt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:38:25
|
Revision: 5181
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5181&view=rev
Author: jdh2358
Date: 2008-05-17 14:38:21 -0700 (Sat, 17 May 2008)
Log Message:
-----------
fixed some typos in the CODING_GUIDE
Modified Paths:
--------------
branches/v0_91_maint/CODING_GUIDE
Modified: branches/v0_91_maint/CODING_GUIDE
===================================================================
--- branches/v0_91_maint/CODING_GUIDE 2008-05-17 21:32:33 UTC (rev 5180)
+++ branches/v0_91_maint/CODING_GUIDE 2008-05-17 21:38:21 UTC (rev 5181)
@@ -41,11 +41,13 @@
MANIFEST.in. This file determines what goes into the src
distribution of the mpl build.
- * Keep the maintenance branch and trunk in sync here it makes sense.
+ * Keep the maintenance branch and trunk in sync where it makes sense.
If there is a bug on both that needs fixing, use svnmerge.py to
- fix them. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
+ keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
basic procedure is:
+ - install svnmerge.py in your PATH
+
- get a svn copy of the branch (svn co
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint)
and the trunk (svn co
@@ -55,8 +57,9 @@
it. Make sure you svn upped on the trunk and have no local
modifications, and then from the svn trunk do
- # where these are the revision numbers. ranges also acceptable
+ # where the NNN are the revision numbers. ranges also acceptable
> svnmerge.py merge -rNNN1,NNN2
+
# this file is automatically created by the merge command
> svn commit -F svnmerge-commit-message.txt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:32:41
|
Revision: 5180
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5180&view=rev
Author: jdh2358
Date: 2008-05-17 14:32:33 -0700 (Sat, 17 May 2008)
Log Message:
-----------
Merged revisions 5178-5179 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r5178 | jdh2358 | 2008-05-17 16:28:34 -0500 (Sat, 17 May 2008) | 1 line
updated the coding guide to encourage svnmerge
........
r5179 | jdh2358 | 2008-05-17 16:30:23 -0500 (Sat, 17 May 2008) | 1 line
a few more doc string fixes in cboo
........
Modified Paths:
--------------
trunk/matplotlib/CODING_GUIDE
trunk/matplotlib/lib/matplotlib/cbook.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4816,5172
+ /branches/v0_91_maint:1-4816,5172,5178-5179
Modified: trunk/matplotlib/CODING_GUIDE
===================================================================
--- trunk/matplotlib/CODING_GUIDE 2008-05-17 21:30:23 UTC (rev 5179)
+++ trunk/matplotlib/CODING_GUIDE 2008-05-17 21:32:33 UTC (rev 5180)
@@ -41,10 +41,30 @@
MANIFEST.in. This file determines what goes into the src
distribution of the mpl build.
+ * Keep the maintenance branch and trunk in sync here it makes sense.
+ If there is a bug on both that needs fixing, use svnmerge.py to
+ fix them. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
+ basic procedure is:
+
+ - get a svn copy of the branch (svn co
+ https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint)
+ and the trunk (svn co
+ https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib)
+
+ - Michael advises making the change on the branch and committing
+ it. Make sure you svn upped on the trunk and have no local
+ modifications, and then from the svn trunk do
+
+ # where these are the revision numbers. ranges also acceptable
+ > svnmerge.py merge -rNNN1,NNN2
+ # this file is automatically created by the merge command
+ > svn commit -F svnmerge-commit-message.txt
+
== Importing and name spaces ==
For numpy, use:
+
import numpy as np
a = np.array([1,2,3])
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-17 21:30:23 UTC (rev 5179)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-17 21:32:33 UTC (rev 5180)
@@ -198,21 +198,25 @@
return dict([ (val, 1) for val in x]).keys()
def iterable(obj):
+ 'return true if obj is iterable'
try: len(obj)
except: return 0
return 1
def is_string_like(obj):
+ 'return true if obj looks like a string'
if hasattr(obj, 'shape'): return 0
try: obj + ''
except (TypeError, ValueError): return 0
return 1
def is_writable_file_like(obj):
+ 'return true if obj looks like a file object'
return hasattr(obj, 'write') and callable(obj.write)
def is_scalar(obj):
+ 'return true if ob is not string like and is not iterable'
return is_string_like(obj) or not iterable(obj)
def is_numlike(obj):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:30:29
|
Revision: 5179
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5179&view=rev
Author: jdh2358
Date: 2008-05-17 14:30:23 -0700 (Sat, 17 May 2008)
Log Message:
-----------
a few more doc string fixes in cboo
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/cbook.py
Modified: branches/v0_91_maint/lib/matplotlib/cbook.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/cbook.py 2008-05-17 21:28:34 UTC (rev 5178)
+++ branches/v0_91_maint/lib/matplotlib/cbook.py 2008-05-17 21:30:23 UTC (rev 5179)
@@ -202,21 +202,25 @@
return dict([ (val, 1) for val in x]).keys()
def iterable(obj):
+ 'return true if obj is iterable'
try: len(obj)
except: return 0
return 1
def is_string_like(obj):
+ 'return true if obj looks like a string'
if hasattr(obj, 'shape'): return 0
try: obj + ''
except (TypeError, ValueError): return 0
return 1
def is_writable_file_like(obj):
+ 'return true if obj looks like a file object'
return hasattr(obj, 'write') and callable(obj.write)
def is_scalar(obj):
+ 'return true if ob is not string like and is not iterable'
return is_string_like(obj) or not iterable(obj)
def is_numlike(obj):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:28:46
|
Revision: 5178
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5178&view=rev
Author: jdh2358
Date: 2008-05-17 14:28:34 -0700 (Sat, 17 May 2008)
Log Message:
-----------
updated the coding guide to encourage svnmerge
Modified Paths:
--------------
branches/v0_91_maint/CODING_GUIDE
Modified: branches/v0_91_maint/CODING_GUIDE
===================================================================
--- branches/v0_91_maint/CODING_GUIDE 2008-05-17 21:20:15 UTC (rev 5177)
+++ branches/v0_91_maint/CODING_GUIDE 2008-05-17 21:28:34 UTC (rev 5178)
@@ -12,7 +12,7 @@
# checking out the main src
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib --username=youruser --password=yourpass
-# branch checkouts, eg the transforms branch
+# branch checkouts, eg the transforms branch
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/transforms transbranch
== Committing changes ==
@@ -41,14 +41,33 @@
MANIFEST.in. This file determines what goes into the src
distribution of the mpl build.
+ * Keep the maintenance branch and trunk in sync here it makes sense.
+ If there is a bug on both that needs fixing, use svnmerge.py to
+ fix them. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
+ basic procedure is:
+
+ - get a svn copy of the branch (svn co
+ https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint)
+ and the trunk (svn co
+ https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib)
+
+ - Michael advises making the change on the branch and committing
+ it. Make sure you svn upped on the trunk and have no local
+ modifications, and then from the svn trunk do
+
+ # where these are the revision numbers. ranges also acceptable
+ > svnmerge.py merge -rNNN1,NNN2
+ # this file is automatically created by the merge command
+ > svn commit -F svnmerge-commit-message.txt
+
== Importing and name spaces ==
For numpy, use:
import numpy as npy
a = npy.array([1,2,3])
-
+
For masked arrays, use:
import matplotlib.numerix.npyma as ma
@@ -64,8 +83,8 @@
For matplotlib modules (or any other modules), use:
- import matplotlib.cbook as cbook
-
+ import matplotlib.cbook as cbook
+
if cbook.iterable(z):
pass
@@ -125,7 +144,7 @@
(add-hook 'python-mode-hook
(lambda ()
- (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
+ (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:20:17
|
Revision: 5177
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5177&view=rev
Author: jdh2358
Date: 2008-05-17 14:20:15 -0700 (Sat, 17 May 2008)
Log Message:
-----------
Merged revisions 5172 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_91_maint
........
r5172 | jdh2358 | 2008-05-17 16:06:05 -0500 (Sat, 17 May 2008) | 1 line
added a doc string to the branch -- just experimenting with svn merge here
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/cbook.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-4816
+ /branches/v0_91_maint:1-4816,5172
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-17 21:19:10 UTC (rev 5176)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-17 21:20:15 UTC (rev 5177)
@@ -216,6 +216,7 @@
return is_string_like(obj) or not iterable(obj)
def is_numlike(obj):
+ 'return true if obj looks like a number'
try: obj+1
except TypeError: return False
else: return True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:19:13
|
Revision: 5176
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5176&view=rev
Author: jdh2358
Date: 2008-05-17 14:19:10 -0700 (Sat, 17 May 2008)
Log Message:
-----------
trying to reinit merge
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
+ /branches/v0_91_maint:1-4816
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:18:55
|
Revision: 5175
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5175&view=rev
Author: jdh2358
Date: 2008-05-17 14:18:53 -0700 (Sat, 17 May 2008)
Log Message:
-----------
trying to reinit merge
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5173
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:14:55
|
Revision: 5174
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5174&view=rev
Author: jdh2358
Date: 2008-05-17 14:14:53 -0700 (Sat, 17 May 2008)
Log Message:
-----------
screwed up merge, trying to clean up
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5136
+ /branches/v0_91_maint:1-5173
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:06:40
|
Revision: 5173
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5173&view=rev
Author: jdh2358
Date: 2008-05-17 14:06:39 -0700 (Sat, 17 May 2008)
Log Message:
-----------
committing in advance of a merge
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-05-17 21:06:05 UTC (rev 5172)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-05-17 21:06:39 UTC (rev 5173)
@@ -290,7 +290,7 @@
original_dpi = renderer.dpi
renderer.dpi = self.figure.dpi
if type(filename_or_obj) in (str, unicode):
- filename_or_obj = open(filename_or_obj, 'wb')
+ filename_or_obj = opefile(filename_or_obj, 'wb')
renderer._renderer.write_rgba(filename_or_obj)
renderer.dpi = original_dpi
print_rgba = print_raw
@@ -301,6 +301,6 @@
original_dpi = renderer.dpi
renderer.dpi = self.figure.dpi
if type(filename_or_obj) in (str, unicode):
- filename_or_obj = open(filename_or_obj, 'wb')
+ filename_or_obj = file(filename_or_obj, 'wb')
self.get_renderer()._renderer.write_png(filename_or_obj, self.figure.dpi)
renderer.dpi = original_dpi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 21:06:10
|
Revision: 5172
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5172&view=rev
Author: jdh2358
Date: 2008-05-17 14:06:05 -0700 (Sat, 17 May 2008)
Log Message:
-----------
added a doc string to the branch -- just experimenting with svn merge here
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/cbook.py
Modified: branches/v0_91_maint/lib/matplotlib/cbook.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/cbook.py 2008-05-17 20:57:13 UTC (rev 5171)
+++ branches/v0_91_maint/lib/matplotlib/cbook.py 2008-05-17 21:06:05 UTC (rev 5172)
@@ -220,6 +220,7 @@
return is_string_like(obj) or not iterable(obj)
def is_numlike(obj):
+ 'return true if obj looks like a number'
try: obj+1
except TypeError: return False
else: return True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-17 20:57:15
|
Revision: 5171
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5171&view=rev
Author: jdh2358
Date: 2008-05-17 13:57:13 -0700 (Sat, 17 May 2008)
Log Message:
-----------
made backend agg open png in binary mode
Modified Paths:
--------------
branches/v0_91_maint/examples/embedding_in_gtk2.py
branches/v0_91_maint/examples/embedding_in_tk.py
branches/v0_91_maint/examples/embedding_in_tk2.py
branches/v0_91_maint/examples/mathtext_demo.py
branches/v0_91_maint/examples/mathtext_examples.py
branches/v0_91_maint/lib/matplotlib/backends/backend_agg.py
Modified: branches/v0_91_maint/examples/embedding_in_gtk2.py
===================================================================
--- branches/v0_91_maint/examples/embedding_in_gtk2.py 2008-05-17 17:05:36 UTC (rev 5170)
+++ branches/v0_91_maint/examples/embedding_in_gtk2.py 2008-05-17 20:57:13 UTC (rev 5171)
@@ -5,7 +5,6 @@
"""
import gtk
-from matplotlib.axes import Subplot
from matplotlib.figure import Figure
from numpy import arange, sin, pi
Modified: branches/v0_91_maint/examples/embedding_in_tk.py
===================================================================
--- branches/v0_91_maint/examples/embedding_in_tk.py 2008-05-17 17:05:36 UTC (rev 5170)
+++ branches/v0_91_maint/examples/embedding_in_tk.py 2008-05-17 20:57:13 UTC (rev 5171)
@@ -1,7 +1,4 @@
#!/usr/bin/env python
-import matplotlib
-matplotlib.use('TkAgg')
-
from numpy import arange, sin, pi
from matplotlib.axes import Subplot
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
Modified: branches/v0_91_maint/examples/embedding_in_tk2.py
===================================================================
--- branches/v0_91_maint/examples/embedding_in_tk2.py 2008-05-17 17:05:36 UTC (rev 5170)
+++ branches/v0_91_maint/examples/embedding_in_tk2.py 2008-05-17 20:57:13 UTC (rev 5171)
@@ -1,43 +1,38 @@
#!/usr/bin/env python
-import matplotlib
-matplotlib.use('TkAgg')
-
-from numpy import arange, sin, pi
-from matplotlib.axes import Subplot
-from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
-from matplotlib.figure import Figure
-
import Tkinter as Tk
-import sys
+import numpy as np
+import matplotlib.backends.backend_tkagg as backend
+import matplotlib.figure as mfigure
-def destroy(e): sys.exit()
root = Tk.Tk()
root.wm_title("Embedding in TK")
-#root.bind("<Destroy>", destroy)
+fig = mfigure.Figure(figsize=(5,4), dpi=100)
+ax = fig.add_subplot(111)
+t = np.arange(0.0,3.0,0.01)
+s = np.sin(2*np.pi*t)
-f = Figure(figsize=(5,4), dpi=100)
-a = f.add_subplot(111)
-t = arange(0.0,3.0,0.01)
-s = sin(2*pi*t)
+ax.plot(t,s)
+ax.grid(True)
+ax.set_title('Tk embedding')
+ax.set_xlabel('time (s)')
+ax.set_ylabel('volts (V)')
-a.plot(t,s)
-a.set_title('Tk embedding')
-a.set_xlabel('X axis label')
-a.set_ylabel('Y label')
-
# a tk.DrawingArea
-canvas = FigureCanvasTkAgg(f, master=root)
+canvas = backend.FigureCanvasTkAgg(fig, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
-#toolbar = NavigationToolbar2TkAgg( canvas, root )
+#toolbar = backend.NavigationToolbar2TkAgg( canvas, root )
#toolbar.update()
-canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
+#toolbar.pack(side=Tk.LEFT)
-button = Tk.Button(master=root, text='Quit', command=sys.exit)
+def destroy():
+ raise SystemExit
+
+button = Tk.Button(master=root, text='Quit', command=destroy)
button.pack(side=Tk.BOTTOM)
Tk.mainloop()
Modified: branches/v0_91_maint/examples/mathtext_demo.py
===================================================================
--- branches/v0_91_maint/examples/mathtext_demo.py 2008-05-17 17:05:36 UTC (rev 5170)
+++ branches/v0_91_maint/examples/mathtext_demo.py 2008-05-17 20:57:13 UTC (rev 5171)
@@ -18,7 +18,7 @@
ax.set_ylabel(r'$\Delta_{i+1}^j$', fontsize=20)
tex = r'$\mathcal{R}\prod_{i=\alpha_{i+1}}^\infty a_i\sin(2 \pi f x_i)$'
-ax.text(1, 1.6, tex, fontsize=20, va='bottom')
+mymath = ax.text(1, 1.6, tex, fontsize=20, va='bottom')
ax.legend(("Foo", "Testing $x^2$"))
Modified: branches/v0_91_maint/examples/mathtext_examples.py
===================================================================
--- branches/v0_91_maint/examples/mathtext_examples.py 2008-05-17 17:05:36 UTC (rev 5170)
+++ branches/v0_91_maint/examples/mathtext_examples.py 2008-05-17 20:57:13 UTC (rev 5171)
@@ -49,7 +49,7 @@
r'$\widehat{abc}\widetilde{def}$',
r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$',
r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$',
- ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
+ #ur'Generic symbol: $\u23ce \mathrm{\ue0f2 \U0001D538}$'
]
from pylab import *
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_agg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_agg.py 2008-05-17 17:05:36 UTC (rev 5170)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_agg.py 2008-05-17 20:57:13 UTC (rev 5171)
@@ -390,14 +390,14 @@
def print_raw(self, filename_or_obj, *args, **kwargs):
self.draw()
if type(filename_or_obj) in (str, unicode):
- filename_or_obj = open(filename_or_obj, 'w')
+ filename_or_obj = file(filename_or_obj, 'wb')
self.get_renderer()._renderer.write_rgba(filename_or_obj)
print_rgba = print_raw
def print_png(self, filename_or_obj, *args, **kwargs):
self.draw()
if type(filename_or_obj) in (str, unicode):
- filename_or_obj = open(filename_or_obj, 'w')
+ filename_or_obj = file(filename_or_obj, 'wb')
self.get_renderer()._renderer.write_png(filename_or_obj,
self.figure.dpi.get())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-05-17 17:05:39
|
Revision: 5170
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5170&view=rev
Author: efiring
Date: 2008-05-17 10:05:36 -0700 (Sat, 17 May 2008)
Log Message:
-----------
Open png files in binary mode; bug found by J?\195?\182rgen Stenarson
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-05-17 13:33:42 UTC (rev 5169)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-05-17 17:05:36 UTC (rev 5170)
@@ -290,7 +290,7 @@
original_dpi = renderer.dpi
renderer.dpi = self.figure.dpi
if type(filename_or_obj) in (str, unicode):
- filename_or_obj = open(filename_or_obj, 'w')
+ filename_or_obj = open(filename_or_obj, 'wb')
renderer._renderer.write_rgba(filename_or_obj)
renderer.dpi = original_dpi
print_rgba = print_raw
@@ -301,6 +301,6 @@
original_dpi = renderer.dpi
renderer.dpi = self.figure.dpi
if type(filename_or_obj) in (str, unicode):
- filename_or_obj = open(filename_or_obj, 'w')
+ filename_or_obj = open(filename_or_obj, 'wb')
self.get_renderer()._renderer.write_png(filename_or_obj, self.figure.dpi)
renderer.dpi = original_dpi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-05-17 13:33:44
|
Revision: 5169
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5169&view=rev
Author: jswhit
Date: 2008-05-17 06:33:42 -0700 (Sat, 17 May 2008)
Log Message:
-----------
convert to pyplot/numpy namespace
Modified Paths:
--------------
trunk/toolkits/basemap/examples/warpimage.py
Modified: trunk/toolkits/basemap/examples/warpimage.py
===================================================================
--- trunk/toolkits/basemap/examples/warpimage.py 2008-05-17 12:22:09 UTC (rev 5168)
+++ trunk/toolkits/basemap/examples/warpimage.py 2008-05-17 13:33:42 UTC (rev 5169)
@@ -1,13 +1,13 @@
-import pylab as P
-import numpy
from mpl_toolkits.basemap import Basemap
+import numpy as np
+import matplotlib.pyplot as plt
# illustrate use of warpimage method to display an image background
# on the map projection region. Default background is the 'blue
# marble' image from NASA (http://visibleearth.nasa.gov).
# create new figure
-fig=P.figure()
+fig=plt.figure()
# define orthographic projection centered on North America.
m = Basemap(projection='ortho',lat_0=40,lon_0=-100,resolution='l')
# display a non-default image.
@@ -15,17 +15,17 @@
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines every 30 degrees.
-m.drawmeridians(numpy.arange(0,360,30),color='0.5')
-m.drawparallels(numpy.arange(-90,90,30),color='0.5')
-P.title("Lights at Night image warped from 'cyl' to 'ortho' projection",fontsize=12)
+m.drawmeridians(np.arange(0,360,30),color='0.5')
+m.drawparallels(np.arange(-90,90,30),color='0.5')
+plt.title("Lights at Night image warped from 'cyl' to 'ortho' projection",fontsize=12)
print 'warp to orthographic map ...'
# redisplay (same image specified) should be fast since data is cached.
-fig = P.figure()
+fig = plt.figure()
m.warpimage(image='earth_lights_lrg.jpg')
# create new figure
-fig=P.figure()
+fig=plt.figure()
# define cylindrical equidistant projection.
m = Basemap(projection='cyl',llcrnrlon=-180,llcrnrlat=-90,urcrnrlon=180,urcrnrlat=90,resolution='l')
# plot (unwarped) rgba image.
@@ -33,13 +33,13 @@
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines.
-m.drawmeridians(numpy.arange(-180,180,60),labels=[0,0,0,1],color='0.5')
-m.drawparallels(numpy.arange(-90,90,30),labels=[1,0,0,0],color='0.5')
-P.title("Blue Marble image - native 'cyl' projection",fontsize=12)
+m.drawmeridians(np.arange(-180,180,60),labels=[0,0,0,1],color='0.5')
+m.drawparallels(np.arange(-90,90,30),labels=[1,0,0,0],color='0.5')
+plt.title("Blue Marble image - native 'cyl' projection",fontsize=12)
print 'plot cylindrical map (no warping needed) ...'
# create new figure
-fig=P.figure()
+fig=plt.figure()
# define orthographic projection centered on Europe.
m = Basemap(projection='ortho',lat_0=40,lon_0=40,resolution='l')
# plot warped rgba image.
@@ -47,13 +47,13 @@
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines every 30 degrees.
-m.drawmeridians(numpy.arange(0,360,30),color='0.5')
-m.drawparallels(numpy.arange(-90,90,30),color='0.5')
-P.title("Blue Marble image warped from 'cyl' to 'ortho' projection",fontsize=12)
+m.drawmeridians(np.arange(0,360,30),color='0.5')
+m.drawparallels(np.arange(-90,90,30),color='0.5')
+plt.title("Blue Marble image warped from 'cyl' to 'ortho' projection",fontsize=12)
print 'warp to orthographic map ...'
# create new figure
-fig=P.figure()
+fig=plt.figure()
# define Lambert Conformal basemap for North America.
m = Basemap(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
rsphere=(6378137.00,6356752.3142),lat_1=50.,lon_0=-107.,\
@@ -63,15 +63,15 @@
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw parallels and meridians.
# label on left, right and bottom of map.
-parallels = numpy.arange(0.,80,20.)
+parallels = np.arange(0.,80,20.)
m.drawparallels(parallels,labels=[1,1,0,1],color='0.5')
-meridians = numpy.arange(10.,360.,30.)
+meridians = np.arange(10.,360.,30.)
m.drawmeridians(meridians,labels=[1,1,0,1],color='0.5')
-P.title("Blue Marble image warped from 'cyl' to 'lcc' projection",fontsize=12)
+plt.title("Blue Marble image warped from 'cyl' to 'lcc' projection",fontsize=12)
print 'warp to lambert conformal map ...'
# create new figure
-fig=P.figure()
+fig=plt.figure()
# define oblique mercator map.
m = Basemap(height=24000000,width=12000000,
resolution=None,projection='omerc',\
@@ -79,9 +79,9 @@
# plot warped rgba image.
im = m.bluemarble()
# draw lat/lon grid lines every 20 degrees.
-m.drawmeridians(numpy.arange(0,360,20),color='0.5')
-m.drawparallels(numpy.arange(-80,81,20),color='0.5')
-P.title("Blue Marble image warped from 'cyl' to 'omerc' projection",fontsize=12)
+m.drawmeridians(np.arange(0,360,20),color='0.5')
+m.drawparallels(np.arange(-80,81,20),color='0.5')
+plt.title("Blue Marble image warped from 'cyl' to 'omerc' projection",fontsize=12)
print 'warp to oblique mercator map ...'
-P.show()
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-05-17 12:22:13
|
Revision: 5168
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5168&view=rev
Author: jswhit
Date: 2008-05-17 05:22:09 -0700 (Sat, 17 May 2008)
Log Message:
-----------
convert to pyplot/numpy namespace
Modified Paths:
--------------
trunk/toolkits/basemap/examples/contour_demo.py
Modified: trunk/toolkits/basemap/examples/contour_demo.py
===================================================================
--- trunk/toolkits/basemap/examples/contour_demo.py 2008-05-17 12:04:34 UTC (rev 5167)
+++ trunk/toolkits/basemap/examples/contour_demo.py 2008-05-17 12:22:09 UTC (rev 5168)
@@ -1,124 +1,125 @@
from mpl_toolkits.basemap import Basemap, shiftgrid
-from pylab import load, show, colorbar, axes, gca,\
- figure, title, meshgrid, cm, arange
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
# examples of filled contour plots on map projections.
# read in data on lat/lon grid.
-hgt = load('500hgtdata.gz')
-lons = load('500hgtlons.gz')
-lats = load('500hgtlats.gz')
+hgt = mlab.load('500hgtdata.gz')
+lons = mlab.load('500hgtlons.gz')
+lats = mlab.load('500hgtlats.gz')
# shift data so lons go from -180 to 180 instead of 0 to 360.
hgt,lons = shiftgrid(180.,hgt,lons,start=False)
-lons, lats = meshgrid(lons, lats)
+lons, lats = np.meshgrid(lons, lats)
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of sinusoidal basemap
m = Basemap(resolution='c',projection='sinu',lon_0=0)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# make a filled contour plot.
x, y = m(lons, lats)
CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
+CS = m.contourf(x,y,hgt,15,cmap=plt.cm.jet)
# setup colorbar axes instance.
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
-colorbar(drawedges=True, cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
+plt.colorbar(drawedges=True, cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawmapboundary()
m.fillcontinents()
# draw parallels and meridians.
-parallels = arange(-60.,90,30.)
+parallels = np.arange(-60.,90,30.)
m.drawparallels(parallels,labels=[1,0,0,0])
-meridians = arange(-360.,360.,30.)
+meridians = np.arange(-360.,360.,30.)
m.drawmeridians(meridians)
-title('Sinusoidal Filled Contour Demo')
+plt.title('Sinusoidal Filled Contour Demo')
print 'plotting with sinusoidal basemap ...'
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of mollweide basemap
m = Basemap(resolution='c',projection='moll',lon_0=0)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# make a filled contour plot.
x, y = m(lons, lats)
CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
+CS = m.contourf(x,y,hgt,15,cmap=plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
-colorbar(drawedges=True, cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
+plt.colorbar(drawedges=True, cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawmapboundary()
m.fillcontinents()
# draw parallels and meridians.
-parallels = arange(-60.,90,30.)
+parallels = np.arange(-60.,90,30.)
m.drawparallels(parallels,labels=[1,0,0,0])
-meridians = arange(-360.,360.,30.)
+meridians = np.arange(-360.,360.,30.)
m.drawmeridians(meridians)
-title('Mollweide Filled Contour Demo')
+plt.title('Mollweide Filled Contour Demo')
print 'plotting with mollweide basemap ...'
# create new figure
-fig=figure()
+fig=plt.figure()
# set up Robinson map projection.
m = Basemap(resolution='c',projection='robin',lon_0=0)
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# make a filled contour plot.
x, y = m(lons, lats)
CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
+CS = m.contourf(x,y,hgt,15,cmap=plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
-colorbar(drawedges=True, cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
+plt.colorbar(drawedges=True, cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawmapboundary()
m.fillcontinents()
# draw parallels and meridians.
-parallels = arange(-60.,90,30.)
+parallels = np.arange(-60.,90,30.)
m.drawparallels(parallels,labels=[1,0,0,0])
-meridians = arange(-360.,360.,60.)
+meridians = np.arange(-360.,360.,60.)
m.drawmeridians(meridians,labels=[0,0,0,1])
-title('Robinson Filled Contour Demo')
+plt.title('Robinson Filled Contour Demo')
print 'plotting with robinson basemap ...'
# create new figure
-fig=figure()
+fig=plt.figure()
# set up map projection (azimuthal equidistant).
m = Basemap(projection='npaeqd',lon_0=-90,boundinglat=15.,resolution='c')
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# make a filled contour plot.
x, y = m(lons, lats)
CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
+CS = m.contourf(x,y,hgt,15,cmap=plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
-colorbar(drawedges=True, cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
+plt.colorbar(drawedges=True, cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawmapboundary()
m.fillcontinents()
# draw parallels and meridians.
-parallels = arange(0.,80,20.)
+parallels = np.arange(0.,80,20.)
m.drawparallels(parallels,labels=[0,0,1,1])
-meridians = arange(10.,360.,20.)
+meridians = np.arange(10.,360.,20.)
m.drawmeridians(meridians,labels=[1,1,1,1])
-title('Azimuthal Equidistant Filled Contour Demo',y=1.075)
+plt.title('Azimuthal Equidistant Filled Contour Demo',y=1.075)
print 'plotting with azimuthal equidistant basemap ...'
# create new figure
-fig=figure()
+fig=plt.figure()
# setup of orthographic basemap
m = Basemap(resolution='c',projection='ortho',\
lat_0=50.,lon_0=-120.)
@@ -126,22 +127,22 @@
# make a filled contour plot.
x, y = m(lons, lats)
CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k')
-CS = m.contourf(x,y,hgt,15,cmap=cm.jet)
+CS = m.contourf(x,y,hgt,15,cmap=plt.cm.jet)
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
-colorbar(drawedges=True, cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes
+plt.colorbar(drawedges=True, cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# draw coastlines and political boundaries.
m.drawcoastlines()
m.fillcontinents()
m.drawmapboundary()
# draw parallels and meridians.
-parallels = arange(-80.,90,20.)
+parallels = np.arange(-80.,90,20.)
m.drawparallels(parallels)
-meridians = arange(0.,360.,20.)
+meridians = np.arange(0.,360.,20.)
m.drawmeridians(meridians)
-title('Orthographic Filled Contour Demo')
+plt.title('Orthographic Filled Contour Demo')
print 'plotting with orthographic basemap ..'
-show()
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-05-17 12:04:38
|
Revision: 5167
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5167&view=rev
Author: jswhit
Date: 2008-05-17 05:04:34 -0700 (Sat, 17 May 2008)
Log Message:
-----------
convert to pyplot/numpy namespace.
Modified Paths:
--------------
trunk/toolkits/basemap/examples/wiki_example.py
Modified: trunk/toolkits/basemap/examples/wiki_example.py
===================================================================
--- trunk/toolkits/basemap/examples/wiki_example.py 2008-05-17 11:52:15 UTC (rev 5166)
+++ trunk/toolkits/basemap/examples/wiki_example.py 2008-05-17 12:04:34 UTC (rev 5167)
@@ -1,5 +1,6 @@
from mpl_toolkits.basemap import Basemap
-import pylab as p
+import matplotlib.pyplot as plt
+import numpy as np
# set up orthographic map projection with
# perspective of satellite looking down at 50N, 100W.
# use low resolution coastlines.
@@ -11,63 +12,41 @@
# draw the edge of the map projection region (the projection limb)
map.drawmapboundary()
# draw lat/lon grid lines every 30 degrees.
-map.drawmeridians(p.arange(0,360,30))
-map.drawparallels(p.arange(-90,90,30))
+map.drawmeridians(np.arange(0,360,30))
+map.drawparallels(np.arange(-90,90,30))
# lat/lon coordinates of five cities.
lats=[40.02,32.73,38.55,48.25,17.29]
lons=[-105.16,-117.16,-77.00,-114.21,-88.10]
cities=['Boulder, CO','San Diego, CA',
'Washington, DC','Whitefish, MT','Belize City, Belize']
# compute the native map projection coordinates for cities.
-x,y = map(lons,lats)
+xc,yc = map(lons,lats)
# plot filled circles at the locations of the cities.
-map.plot(x,y,'bo')
+map.plot(xc,yc,'bo')
# plot the names of those five cities.
-for name,xpt,ypt in zip(cities,x,y):
- p.text(xpt+50000,ypt+50000,name,fontsize=9)
+for name,xpt,ypt in zip(cities,xc,yc):
+ plt.text(xpt+50000,ypt+50000,name,fontsize=9)
# make up some data on a regular lat/lon grid.
-nlats = 73; nlons = 145; delta = 2.*p.pi/(nlons-1)
-lats = (0.5*p.pi-delta*p.indices((nlats,nlons))[0,:,:])
-lons = (delta*p.indices((nlats,nlons))[1,:,:])
-wave = 0.75*(p.sin(2.*lats)**8*p.cos(4.*lons))
-mean = 0.5*p.cos(2.*lats)*((p.sin(2.*lats))**2 + 2.)
+nlats = 73; nlons = 145; delta = 2.*np.pi/(nlons-1)
+lats = (0.5*np.pi-delta*np.indices((nlats,nlons))[0,:,:])
+lons = (delta*np.indices((nlats,nlons))[1,:,:])
+wave = 0.75*(np.sin(2.*lats)**8*np.cos(4.*lons))
+mean = 0.5*np.cos(2.*lats)*((np.sin(2.*lats))**2 + 2.)
# compute native map projection coordinates of lat/lon grid.
-x, y = map(lons*180./p.pi, lats*180./p.pi)
+x, y = map(lons*180./np.pi, lats*180./np.pi)
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
# as above, but use blue marble image as map background.
-fig = p.figure()
-map = Basemap(projection='ortho',lat_0=50,lon_0=-100,resolution='l')
+fig = plt.figure()
map.drawmapboundary()
-map.drawmeridians(p.arange(0,360,30))
-map.drawparallels(p.arange(-90,90,30))
-# lat/lon coordinates of five cities.
-lats=[40.02,32.73,38.55,48.25,17.29]
-lons=[-105.16,-117.16,-77.00,-114.21,-88.10]
-cities=['Boulder, CO','San Diego, CA',
- 'Washington, DC','Whitefish, MT','Belize City, Belize']
-# compute the native map projection coordinates for cities.
-x,y = map(lons,lats)
-# plot filled circles at the locations of the cities.
-map.plot(x,y,'yo')
-# plot the names of those five cities.
-for name,xpt,ypt in zip(cities,x,y):
- p.text(xpt+50000,ypt+50000,name,fontsize=9,color='w')
-# make up some data on a regular lat/lon grid.
-nlats = 73; nlons = 145; delta = 2.*p.pi/(nlons-1)
-lats = (0.5*p.pi-delta*p.indices((nlats,nlons))[0,:,:])
-lons = (delta*p.indices((nlats,nlons))[1,:,:])
-wave = 0.75*(p.sin(2.*lats)**8*p.cos(4.*lons))
-mean = 0.5*p.cos(2.*lats)*((p.sin(2.*lats))**2 + 2.)
-# compute native map projection coordinates of lat/lon grid.
-x, y = map(lons*180./p.pi, lats*180./p.pi)
+map.drawmeridians(np.arange(0,360,30))
+map.drawparallels(np.arange(-90,90,30))
+# plot the names of five cities.
+for name,xpt,ypt in zip(cities,xc,yc):
+ plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w')
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
# draw blue marble image in background.
map.bluemarble()
-p.show()
-
-#p.savefig('wiki_example.ps')
-
-
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-05-17 11:52:25
|
Revision: 5166
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5166&view=rev
Author: jswhit
Date: 2008-05-17 04:52:15 -0700 (Sat, 17 May 2008)
Log Message:
-----------
convert to pyplot/numpy namespace
Modified Paths:
--------------
trunk/toolkits/basemap/examples/plotmap.py
trunk/toolkits/basemap/examples/plotmap_masked.py
trunk/toolkits/basemap/examples/plotmap_oo.py
Modified: trunk/toolkits/basemap/examples/plotmap.py
===================================================================
--- trunk/toolkits/basemap/examples/plotmap.py 2008-05-16 22:47:00 UTC (rev 5165)
+++ trunk/toolkits/basemap/examples/plotmap.py 2008-05-17 11:52:15 UTC (rev 5166)
@@ -5,14 +5,15 @@
# the data is interpolated to the native projection grid.
from mpl_toolkits.basemap import Basemap, shiftgrid
-from pylab import title, colorbar, show, axes, cm, load, arange, figure, \
- text
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
# read in topo data (on a regular lat/lon grid)
# longitudes go from 20 to 380.
-topoin = load('etopo20data.gz')
-lons = load('etopo20lons.gz')
-lats = load('etopo20lats.gz')
+topoin = mlab.load('etopo20data.gz')
+lons = mlab.load('etopo20lons.gz')
+lats = mlab.load('etopo20lats.gz')
# shift data so lons go from -180 to 180 instead of 20 to 380.
topoin,lons = shiftgrid(180.,topoin,lons,start=False)
@@ -26,31 +27,32 @@
nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1
topodat,x,y = m.transform_scalar(topoin,lons,lats,nx,ny,returnxy=True)
# create the figure.
-fig=figure(figsize=(8,8))
+fig=plt.figure(figsize=(8,8))
# add an axes, leaving room for colorbar on the right.
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# plot image over map with imshow.
-im = m.imshow(topodat,cm.jet)
+im = m.imshow(topodat,plt.cm.jet)
# setup colorbar axes instance.
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h])
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h])
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# plot blue dot on boulder, colorado and label it as such.
xpt,ypt = m(-104.237,40.125)
m.plot([xpt],[ypt],'bo')
-text(xpt+100000,ypt+100000,'Boulder')
+plt.text(xpt+100000,ypt+100000,'Boulder')
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawcountries()
m.drawstates()
# draw parallels and meridians.
# label on left, right and bottom of map.
-parallels = arange(0.,80,20.)
+parallels = np.arange(0.,80,20.)
m.drawparallels(parallels,labels=[1,1,0,1])
-meridians = arange(10.,360.,30.)
+meridians = np.arange(10.,360.,30.)
m.drawmeridians(meridians,labels=[1,1,0,1])
# set title.
-title('ETOPO Topography - Lambert Conformal Conic')
-show()
+plt.title('ETOPO Topography - Lambert Conformal Conic')
+#plt.savefig('plotmap.pdf')
+plt.show()
Modified: trunk/toolkits/basemap/examples/plotmap_masked.py
===================================================================
--- trunk/toolkits/basemap/examples/plotmap_masked.py 2008-05-16 22:47:00 UTC (rev 5165)
+++ trunk/toolkits/basemap/examples/plotmap_masked.py 2008-05-17 11:52:15 UTC (rev 5166)
@@ -6,16 +6,17 @@
# (in this case the oceans)
from mpl_toolkits.basemap import Basemap, shiftgrid
-from pylab import title, colorbar, show, axes, cm, load, arange, figure, \
- text, where
from numpy import ma
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
import matplotlib.colors as colors
# read in topo data (on a regular lat/lon grid)
# longitudes go from 20 to 380.
-topoin = load('etopo20data.gz')
-lonsin = load('etopo20lons.gz')
-latsin = load('etopo20lats.gz')
+topoin = mlab.load('etopo20data.gz')
+lonsin = mlab.load('etopo20lons.gz')
+latsin = mlab.load('etopo20lats.gz')
# shift data so lons go from -180 to 180 instead of 20 to 380.
topoin,lonsin = shiftgrid(180.,topoin,lonsin,start=False)
@@ -29,36 +30,36 @@
nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1
topodat,x,y = m.transform_scalar(topoin,lonsin,latsin,nx,ny,returnxy=True)
# create the figure.
-fig=figure(figsize=(8,8))
+fig=plt.figure(figsize=(8,8))
# add an axes, leaving room for colorbar on the right.
ax = fig.add_axes([0.1,0.1,0.7,0.7])
# make topodat a masked array, masking values lower than sea level.
-topodat = where(topodat < 0.,1.e10,topodat)
+topodat = np.where(topodat < 0.,1.e10,topodat)
topodatm = ma.masked_values(topodat, 1.e10)
-palette = cm.YlOrRd
+palette = plt.cm.YlOrRd
palette.set_bad('aqua', 1.0)
# plot image over map with imshow.
im = m.imshow(topodatm,palette,norm=colors.normalize(vmin=0.0,vmax=3000.0,clip=False))
# setup colorbar axes instance.
pos = ax.get_position()
l, b, w, h = pos.bounds
-cax = axes([l+w+0.075, b, 0.05, h])
-colorbar(cax=cax) # draw colorbar
-axes(ax) # make the original axes current again
+cax = plt.axes([l+w+0.075, b, 0.05, h])
+plt.colorbar(cax=cax) # draw colorbar
+plt.axes(ax) # make the original axes current again
# plot blue dot on boulder, colorado and label it as such.
xpt,ypt = m(-104.237,40.125)
m.plot([xpt],[ypt],'bo')
-text(xpt+100000,ypt+100000,'Boulder')
+plt.text(xpt+100000,ypt+100000,'Boulder')
# draw coastlines and political boundaries.
m.drawcoastlines()
m.drawcountries()
m.drawstates()
# draw parallels and meridians.
# label on left, right and bottom of map.
-parallels = arange(0.,80,20.)
+parallels = np.arange(0.,80,20.)
m.drawparallels(parallels,labels=[1,1,0,1])
-meridians = arange(10.,360.,30.)
+meridians = np.arange(10.,360.,30.)
m.drawmeridians(meridians,labels=[1,1,0,1])
# set title.
-title('Masked ETOPO Topography - via imshow')
-show()
+plt.title('Masked ETOPO Topography - via imshow')
+plt.show()
Modified: trunk/toolkits/basemap/examples/plotmap_oo.py
===================================================================
--- trunk/toolkits/basemap/examples/plotmap_oo.py 2008-05-16 22:47:00 UTC (rev 5165)
+++ trunk/toolkits/basemap/examples/plotmap_oo.py 2008-05-17 11:52:15 UTC (rev 5166)
@@ -5,7 +5,7 @@
# the data is interpolated to the native projection grid.
##################################
-# pylab-free version of plotmap.py
+# pyplot/pylab-free version of plotmap.py
##################################
# set backend to Agg.
import matplotlib
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 22:47:05
|
Revision: 5165
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5165&view=rev
Author: jdh2358
Date: 2008-05-16 15:47:00 -0700 (Fri, 16 May 2008)
Log Message:
-----------
backend driver fix
Modified Paths:
--------------
trunk/matplotlib/Makefile
trunk/matplotlib/examples/pylab/agg_buffer_to_array.py
trunk/matplotlib/examples/pylab/annotation_demo.py
trunk/matplotlib/examples/pylab/clippedline.py
trunk/matplotlib/examples/pylab/colours.py
trunk/matplotlib/examples/pylab/contourf_log.py
trunk/matplotlib/examples/pylab/custom_projection_example.py
trunk/matplotlib/examples/pylab/custom_scale_example.py
trunk/matplotlib/examples/pylab/data_browser.py
trunk/matplotlib/examples/pylab/fill_between.py
trunk/matplotlib/examples/pylab/geo_demo.py
trunk/matplotlib/examples/pylab/lineprops_dialog_gtk.py
trunk/matplotlib/examples/pylab/mathtext_demo.py
trunk/matplotlib/examples/pylab/pcolor_nonuniform.py
trunk/matplotlib/examples/pylab/polar_bar.py
trunk/matplotlib/examples/pylab/polar_demo.py
trunk/matplotlib/examples/pylab/polar_legend.py
trunk/matplotlib/examples/pylab/quadmesh_demo.py
trunk/matplotlib/examples/pylab/step_demo.py
trunk/matplotlib/examples/pylab/strip_chart_demo.py
trunk/matplotlib/examples/pylab/symlog_demo.py
trunk/matplotlib/examples/pylab/webapp_demo.py
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/Makefile
===================================================================
--- trunk/matplotlib/Makefile 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/Makefile 2008-05-16 22:47:00 UTC (rev 5165)
@@ -15,7 +15,6 @@
rm -f *.png *.ps *.eps *.svg *.jpg *.pdf
find . -name "_tmp*.py" | xargs rm -f;\
find . \( -name "*~" -o -name "*.pyc" \) | xargs rm -f;\
- find examples \( -name "*.svg" C-o -name "*.png" -o -name "*.pdf" -o -name "*.ps" -o -name "*.eps" -o -name "*.tar" -o -name "*.gz" -o -name "*.log" -o -name "*.aux" -o -name "*.tex" \) | xargs rm -f
find unit \( -name "*.png" -o -name "*.ps" -o -name "*.pdf" -o -name "*.eps" \) | xargs rm -f
find . \( -name "#*" -o -name ".#*" -o -name ".*~" -o -name "*~" \) | xargs rm -f
Modified: trunk/matplotlib/examples/pylab/agg_buffer_to_array.py
===================================================================
--- trunk/matplotlib/examples/pylab/agg_buffer_to_array.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/agg_buffer_to_array.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,7 +1,7 @@
import matplotlib
matplotlib.use('Agg')
from pylab import figure, show
-import numpy as npy
+import numpy as np
# make an agg figure
fig = figure()
@@ -13,7 +13,7 @@
# grab rhe pixel buffer and dumpy it into a numpy array
buf = fig.canvas.buffer_rgba(0,0)
l, b, w, h = fig.bbox.bounds
-X = npy.fromstring(buf, npy.uint8)
+X = np.fromstring(buf, np.uint8)
X.shape = h,w,4
# now display the array X as an Axes in a new figure
Modified: trunk/matplotlib/examples/pylab/annotation_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/annotation_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/annotation_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -35,7 +35,7 @@
from matplotlib.pyplot import figure, show
from matplotlib.patches import Ellipse
-import numpy as npy
+import numpy as np
if 1:
@@ -44,8 +44,8 @@
fig = figure()
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), ylim=(-3,5))
- t = npy.arange(0.0, 5.0, 0.01)
- s = npy.cos(2*npy.pi*t)
+ t = np.arange(0.0, 5.0, 0.01)
+ s = np.cos(2*np.pi*t)
line, = ax.plot(t, s, lw=3, color='purple')
ax.annotate('axes center', xy=(.5, .5), xycoords='axes fraction',
@@ -94,8 +94,8 @@
# respected
fig = figure()
ax = fig.add_subplot(111, polar=True)
- r = npy.arange(0,1,0.001)
- theta = 2*2*npy.pi*r
+ r = np.arange(0,1,0.001)
+ theta = 2*2*np.pi*r
line, = ax.plot(theta, r, color='#ee8d18', lw=3)
ind = 800
@@ -124,8 +124,8 @@
ax.add_artist(el)
el.set_clip_box(ax.bbox)
ax.annotate('the top',
- xy=(npy.pi/2., 10.), # theta, radius
- xytext=(npy.pi/3, 20.), # theta, radius
+ xy=(np.pi/2., 10.), # theta, radius
+ xytext=(np.pi/3, 20.), # theta, radius
xycoords='polar',
textcoords='polar',
arrowprops=dict(facecolor='black', shrink=0.05),
Modified: trunk/matplotlib/examples/pylab/clippedline.py
===================================================================
--- trunk/matplotlib/examples/pylab/clippedline.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/clippedline.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -4,7 +4,7 @@
"""
from matplotlib.lines import Line2D
-import numpy as npy
+import numpy as np
from pylab import figure, show
class ClippedLine(Line2D):
@@ -19,13 +19,13 @@
def set_data(self, *args, **kwargs):
Line2D.set_data(self, *args, **kwargs)
- self.xorig = npy.array(self._x)
- self.yorig = npy.array(self._y)
+ self.xorig = np.array(self._x)
+ self.yorig = np.array(self._y)
def draw(self, renderer):
xlim = self.ax.get_xlim()
- ind0, ind1 = npy.searchsorted(self.xorig, xlim)
+ ind0, ind1 = np.searchsorted(self.xorig, xlim)
self._x = self.xorig[ind0:ind1]
self._y = self.yorig[ind0:ind1]
N = len(self._x)
@@ -43,8 +43,8 @@
fig = figure()
ax = fig.add_subplot(111, autoscale_on=False)
-t = npy.arange(0.0, 100.0, 0.01)
-s = npy.sin(2*npy.pi*t)
+t = np.arange(0.0, 100.0, 0.01)
+s = np.sin(2*np.pi*t)
line = ClippedLine(ax, t, s, color='g', ls='-', lw=2)
ax.add_line(line)
ax.set_xlim(10,30)
Modified: trunk/matplotlib/examples/pylab/colours.py
===================================================================
--- trunk/matplotlib/examples/pylab/colours.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/colours.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -2,12 +2,12 @@
"""
Some simple functions to generate colours.
"""
-import numpy as npy
+import numpy as np
from matplotlib.colors import colorConverter
def pastel(colour, weight=2.4):
""" Convert colour into a nice pastel shade"""
- rgb = npy.asarray(colorConverter.to_rgb(colour))
+ rgb = np.asarray(colorConverter.to_rgb(colour))
# scale colour
maxc = max(rgb)
if maxc < 1.0 and maxc > 0:
@@ -31,7 +31,7 @@
def get_colours(n):
""" Return n pastel colours. """
- base = npy.asarray([[1,0,0], [0,1,0], [0,0,1]])
+ base = np.asarray([[1,0,0], [0,1,0], [0,0,1]])
if n <= 3:
return base[0:n]
@@ -42,7 +42,7 @@
colours = []
for start in (0, 1):
- for x in npy.linspace(0, 1, needed[start]+2):
+ for x in np.linspace(0, 1, needed[start]+2):
colours.append((base[start] * (1.0 - x)) +
(base[start+1] * x))
Modified: trunk/matplotlib/examples/pylab/contourf_log.py
===================================================================
--- trunk/matplotlib/examples/pylab/contourf_log.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/contourf_log.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -3,16 +3,16 @@
'''
from matplotlib import pyplot as P
-import numpy as npy
+import numpy as np
from numpy import ma
from matplotlib import colors, ticker
from matplotlib.mlab import bivariate_normal
N = 100
-x = npy.linspace(-3.0, 3.0, N)
-y = npy.linspace(-2.0, 2.0, N)
+x = np.linspace(-3.0, 3.0, N)
+y = np.linspace(-2.0, 2.0, N)
-X, Y = npy.meshgrid(x, y)
+X, Y = np.meshgrid(x, y)
# A low hump with a spike coming out of the top right.
# Needs to have z/colour axis on a log scale so we see both hump and spike.
@@ -34,9 +34,9 @@
# Alternatively, you can manually set the levels
# and the norm:
-#lev_exp = npy.arange(npy.floor(npy.log10(z.min())-1),
-# npy.ceil(npy.log10(z.max())+1))
-#levs = npy.power(10, lev_exp)
+#lev_exp = np.arange(np.floor(np.log10(z.min())-1),
+# np.ceil(np.log10(z.max())+1))
+#levs = np.power(10, lev_exp)
#cs = P.contourf(X, Y, z, levs, norm=colors.LogNorm())
#The 'extend' kwarg does not work yet with a log scale.
Modified: trunk/matplotlib/examples/pylab/custom_projection_example.py
===================================================================
--- trunk/matplotlib/examples/pylab/custom_projection_example.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/custom_projection_example.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -7,7 +7,7 @@
BboxTransformTo, IdentityTransform, Transform, TransformWrapper
from matplotlib.projections import register_projection
-import numpy as npy
+import numpy as np
# This example projection class is rather long, but it is designed to
# illustrate many features, not all of which will be used every time.
@@ -60,8 +60,8 @@
# be changed by the user. This makes the math in the
# transformation itself easier, and since this is a toy
# example, the easier, the better.
- Axes.set_xlim(self, -npy.pi, npy.pi)
- Axes.set_ylim(self, -npy.pi / 2.0, npy.pi / 2.0)
+ Axes.set_xlim(self, -np.pi, np.pi)
+ Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
def cla(self):
"""
@@ -79,8 +79,8 @@
# self.grid(rcParams['axes.grid'])
- Axes.set_xlim(self, -npy.pi, npy.pi)
- Axes.set_ylim(self, -npy.pi / 2.0, npy.pi / 2.0)
+ Axes.set_xlim(self, -np.pi, np.pi)
+ Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
def _set_lim_and_transforms(self):
"""
@@ -117,8 +117,8 @@
# within the axes. The peculiar calculations of xscale and
# yscale are specific to a Aitoff-Hammer projection, so don't
# worry about them too much.
- xscale = 2.0 * npy.sqrt(2.0) * npy.sin(0.5 * npy.pi)
- yscale = npy.sqrt(2.0) * npy.sin(0.5 * npy.pi)
+ xscale = 2.0 * np.sqrt(2.0) * np.sin(0.5 * np.pi)
+ yscale = np.sqrt(2.0) * np.sin(0.5 * np.pi)
self.transAffine = Affine2D() \
.scale(0.5 / xscale, 0.5 / yscale) \
.translate(0.5, 0.5)
@@ -148,8 +148,8 @@
# pixels from the equator.
self._xaxis_pretransform = \
Affine2D() \
- .scale(1.0, npy.pi) \
- .translate(0.0, -npy.pi)
+ .scale(1.0, np.pi) \
+ .translate(0.0, -np.pi)
self._xaxis_transform = \
self._xaxis_pretransform + \
self.transData
@@ -168,7 +168,7 @@
# (1, ymax). The goal of these transforms is to go from that
# space to display space. The tick labels will be offset 4
# pixels from the edge of the axes ellipse.
- yaxis_stretch = Affine2D().scale(npy.pi * 2.0, 1.0).translate(-npy.pi, 0.0)
+ yaxis_stretch = Affine2D().scale(np.pi * 2.0, 1.0).translate(-np.pi, 0.0)
yaxis_space = Affine2D().scale(1.0, 1.1)
self._yaxis_transform = \
yaxis_stretch + \
@@ -265,8 +265,8 @@
# set_xlim and set_ylim to ignore any input. This also applies to
# interactive panning and zooming in the GUI interfaces.
def set_xlim(self, *args, **kwargs):
- Axes.set_xlim(self, -npy.pi, npy.pi)
- Axes.set_ylim(self, -npy.pi / 2.0, npy.pi / 2.0)
+ Axes.set_xlim(self, -np.pi, np.pi)
+ Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
set_ylim = set_xlim
def format_coord(self, long, lat):
@@ -276,8 +276,8 @@
In this case, we want them to be displayed in degrees N/S/E/W.
"""
- long = long * (180.0 / npy.pi)
- lat = lat * (180.0 / npy.pi)
+ long = long * (180.0 / np.pi)
+ lat = lat * (180.0 / np.pi)
if lat >= 0.0:
ns = 'N'
else:
@@ -298,7 +298,7 @@
self._round_to = round_to
def __call__(self, x, pos=None):
- degrees = (x / npy.pi) * 180.0
+ degrees = (x / np.pi) * 180.0
degrees = round(degrees / self._round_to) * self._round_to
# \u00b0 : degree symbol
return u"%d\u00b0" % degrees
@@ -316,7 +316,7 @@
number = (360.0 / degrees) + 1
self.xaxis.set_major_locator(
FixedLocator(
- npy.linspace(-npy.pi, npy.pi, number, True)[1:-1]))
+ np.linspace(-np.pi, np.pi, number, True)[1:-1]))
# Set the formatter to display the tick labels in degrees,
# rather than radians.
self.xaxis.set_major_formatter(self.DegreeFormatter(degrees))
@@ -334,7 +334,7 @@
number = (180.0 / degrees) + 1
self.yaxis.set_major_locator(
FixedLocator(
- npy.linspace(-npy.pi / 2.0, npy.pi / 2.0, number, True)[1:-1]))
+ np.linspace(-np.pi / 2.0, np.pi / 2.0, number, True)[1:-1]))
# Set the formatter to display the tick labels in degrees,
# rather than radians.
self.yaxis.set_major_formatter(self.DegreeFormatter(degrees))
@@ -351,7 +351,7 @@
class -- it provides an interface to something that has no
analogy in the base Axes class.
"""
- longitude_cap = degrees * (npy.pi / 180.0)
+ longitude_cap = degrees * (np.pi / 180.0)
# Change the xaxis gridlines transform so that it draws from
# -degrees to degrees, rather than -pi to pi.
self._xaxis_pretransform \
@@ -412,13 +412,13 @@
# Pre-compute some values
half_long = longitude / 2.0
- cos_latitude = npy.cos(latitude)
- sqrt2 = npy.sqrt(2.0)
+ cos_latitude = np.cos(latitude)
+ sqrt2 = np.sqrt(2.0)
- alpha = 1.0 + cos_latitude * npy.cos(half_long)
- x = (2.0 * sqrt2) * (cos_latitude * npy.sin(half_long)) / alpha
- y = (sqrt2 * npy.sin(latitude)) / alpha
- return npy.concatenate((x, y), 1)
+ alpha = 1.0 + cos_latitude * np.cos(half_long)
+ x = (2.0 * sqrt2) * (cos_latitude * np.sin(half_long)) / alpha
+ y = (sqrt2 * np.sin(latitude)) / alpha
+ return np.concatenate((x, y), 1)
# This is where things get interesting. With this projection,
# straight lines in data space become curves in display space.
@@ -451,10 +451,10 @@
quarter_x = 0.25 * x
half_y = 0.5 * y
- z = npy.sqrt(1.0 - quarter_x*quarter_x - half_y*half_y)
- longitude = 2 * npy.arctan((z*x) / (2.0 * (2.0*z*z - 1.0)))
- latitude = npy.arcsin(y*z)
- return npy.concatenate((longitude, latitude), 1)
+ z = np.sqrt(1.0 - quarter_x*quarter_x - half_y*half_y)
+ longitude = 2 * np.arctan((z*x) / (2.0 * (2.0*z*z - 1.0)))
+ latitude = np.arcsin(y*z)
+ return np.concatenate((longitude, latitude), 1)
transform.__doc__ = Transform.transform.__doc__
def inverted(self):
Modified: trunk/matplotlib/examples/pylab/custom_scale_example.py
===================================================================
--- trunk/matplotlib/examples/pylab/custom_scale_example.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/custom_scale_example.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -36,8 +36,8 @@
thresh: The degree above which to crop the data.
"""
mscale.ScaleBase.__init__(self)
- thresh = kwargs.pop("thresh", (85 / 180.0) * npy.pi)
- if thresh >= npy.pi / 2.0:
+ thresh = kwargs.pop("thresh", (85 / 180.0) * np.pi)
+ if thresh >= np.pi / 2.0:
raise ValueError("thresh must be less than pi/2")
self.thresh = thresh
@@ -67,11 +67,11 @@
class DegreeFormatter(Formatter):
def __call__(self, x, pos=None):
# \u00b0 : degree symbol
- return u"%d\u00b0" % ((x / npy.pi) * 180.0)
+ return u"%d\u00b0" % ((x / np.pi) * 180.0)
- deg2rad = npy.pi / 180.0
+ deg2rad = np.pi / 180.0
axis.set_major_locator(FixedLocator(
- npy.arange(-90, 90, 10) * deg2rad))
+ np.arange(-90, 90, 10) * deg2rad))
axis.set_major_formatter(DegreeFormatter())
axis.set_minor_formatter(DegreeFormatter())
@@ -118,9 +118,9 @@
"""
masked = ma.masked_where((a < -self.thresh) | (a > self.thresh), a)
if masked.mask.any():
- return ma.log(npy.abs(ma.tan(masked) + 1.0 / ma.cos(masked)))
+ return ma.log(np.abs(ma.tan(masked) + 1.0 / ma.cos(masked)))
else:
- return npy.log(npy.abs(npy.tan(a) + 1.0 / npy.cos(a)))
+ return np.log(np.abs(np.tan(a) + 1.0 / np.cos(a)))
def inverted(self):
"""
@@ -139,7 +139,7 @@
self.thresh = thresh
def transform(self, a):
- return npy.arctan(npy.sinh(a))
+ return np.arctan(np.sinh(a))
def inverted(self):
return MercatorLatitudeScale.MercatorLatitudeTransform(self.thresh)
@@ -149,10 +149,10 @@
mscale.register_scale(MercatorLatitudeScale)
from pylab import *
-import numpy as npy
+import numpy as np
t = arange(-180.0, 180.0, 0.1)
-s = t / 360.0 * npy.pi
+s = t / 360.0 * np.pi
plot(t, s, '-', lw=2)
gca().set_yscale('mercator')
Modified: trunk/matplotlib/examples/pylab/data_browser.py
===================================================================
--- trunk/matplotlib/examples/pylab/data_browser.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/data_browser.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,10 +1,10 @@
-import numpy as npy
+import numpy as np
from pylab import figure, show
-X = npy.random.rand(100, 200)
-xs = npy.mean(X, axis=1)
-ys = npy.std(X, axis=1)
+X = np.random.rand(100, 200)
+xs = np.mean(X, axis=1)
+ys = np.std(X, axis=1)
fig = figure()
ax = fig.add_subplot(211)
@@ -25,18 +25,18 @@
transform=ax.transAxes, va='top')
self.selected, = ax.plot([xs[0]], [ys[0]], 'o', ms=12, alpha=0.4,
color='yellow', visible=False)
-
+
def onpress(self, event):
if self.lastind is None: return
if event.key not in ('n', 'p'): return
if event.key=='n': inc = 1
else: inc = -1
-
+
self.lastind += inc
- self.lastind = npy.clip(self.lastind, 0, len(xs)-1)
+ self.lastind = np.clip(self.lastind, 0, len(xs)-1)
self.update()
-
+
def onpick(self, event):
if event.artist!=line: return True
@@ -49,7 +49,7 @@
y = event.mouseevent.ydata
- distances = npy.hypot(x-xs[event.ind], y-ys[event.ind])
+ distances = np.hypot(x-xs[event.ind], y-ys[event.ind])
indmin = distances.argmin()
dataind = event.ind[indmin]
Modified: trunk/matplotlib/examples/pylab/fill_between.py
===================================================================
--- trunk/matplotlib/examples/pylab/fill_between.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/fill_between.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,11 +1,11 @@
#!/usr/bin/env python
import matplotlib.mlab as mlab
from pylab import figure, show
-import numpy as npy
+import numpy as np
-x = npy.arange(0, 2, 0.01)
-y1 = npy.sin(2*npy.pi*x)
-y2 = npy.sin(4*npy.pi*x) + 2
+x = np.arange(0, 2, 0.01)
+y1 = np.sin(2*np.pi*x)
+y2 = np.sin(4*np.pi*x) + 2
fig = figure()
ax = fig.add_subplot(311)
Modified: trunk/matplotlib/examples/pylab/geo_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/geo_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/geo_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,5 +1,5 @@
-import numpy as npy
-npy.seterr("raise")
+import numpy as np
+np.seterr("raise")
from pylab import *
Modified: trunk/matplotlib/examples/pylab/lineprops_dialog_gtk.py
===================================================================
--- trunk/matplotlib/examples/pylab/lineprops_dialog_gtk.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/lineprops_dialog_gtk.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -2,17 +2,17 @@
matplotlib.use('GTKAgg')
from matplotlib.backends.backend_gtk import DialogLineprops
-import numpy as npy
+import numpy as np
from pylab import figure, show
def f(t):
- s1 = npy.cos(2*npy.pi*t)
- e1 = npy.exp(-t)
- return npy.multiply(s1,e1)
+ s1 = np.cos(2*np.pi*t)
+ e1 = np.exp(-t)
+ return np.multiply(s1,e1)
-t1 = npy.arange(0.0, 5.0, 0.1)
-t2 = npy.arange(0.0, 5.0, 0.02)
-t3 = npy.arange(0.0, 2.0, 0.01)
+t1 = np.arange(0.0, 5.0, 0.1)
+t2 = np.arange(0.0, 5.0, 0.02)
+t3 = np.arange(0.0, 2.0, 0.01)
fig = figure()
ax = fig.add_subplot(111)
Modified: trunk/matplotlib/examples/pylab/mathtext_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/mathtext_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/mathtext_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -3,7 +3,7 @@
Use matplotlib's internal LaTex parser and layout engine. For true
latex rendering, see the text.usetex option
"""
-import numpy as npy
+import numpy as np
from matplotlib.pyplot import figure, show
fig = figure()
@@ -11,7 +11,7 @@
ax = fig.add_subplot(111, axisbg='y')
ax.plot([1,2,3], 'r')
-x = npy.arange(0.0, 3.0, 0.1)
+x = np.arange(0.0, 3.0, 0.1)
ax.grid(True)
ax.set_xlabel(r'$\Delta_i^j$', fontsize=20)
Modified: trunk/matplotlib/examples/pylab/pcolor_nonuniform.py
===================================================================
--- trunk/matplotlib/examples/pylab/pcolor_nonuniform.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/pcolor_nonuniform.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,11 +1,11 @@
from matplotlib.pyplot import figure, show
-import numpy as npy
+import numpy as np
from matplotlib.image import NonUniformImage
-x = npy.arange(-4, 4, 0.005)
-y = npy.arange(-4, 4, 0.005)
+x = np.arange(-4, 4, 0.005)
+y = np.arange(-4, 4, 0.005)
print 'Size %d points' % (len(x) * len(y))
-z = npy.sqrt(x[npy.newaxis,:]**2 + y[:,npy.newaxis]**2)
+z = np.sqrt(x[np.newaxis,:]**2 + y[:,np.newaxis]**2)
fig = figure()
ax = fig.add_subplot(111)
Modified: trunk/matplotlib/examples/pylab/polar_bar.py
===================================================================
--- trunk/matplotlib/examples/pylab/polar_bar.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/polar_bar.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import numpy as npy
+import numpy as np
import matplotlib.cm as cm
from matplotlib.pyplot import figure, show, rc
@@ -10,9 +10,9 @@
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
N = 20
-theta = npy.arange(0.0, 2*npy.pi, 2*npy.pi/N)
-radii = 10*npy.random.rand(N)
-width = npy.pi/4*npy.random.rand(N)
+theta = np.arange(0.0, 2*np.pi, 2*np.pi/N)
+radii = 10*np.random.rand(N)
+width = np.pi/4*np.random.rand(N)
bars = ax.bar(theta, radii, width=width, bottom=0.0)
for r,bar in zip(radii, bars):
bar.set_facecolor( cm.jet(r/10.))
Modified: trunk/matplotlib/examples/pylab/polar_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/polar_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/polar_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -39,7 +39,7 @@
# See the pylab rgrids and thetagrids functions for
# information on how to customize the grid locations and labels
-import numpy as npy
+import numpy as np
from matplotlib.pyplot import figure, show, rc, grid
# radar green, solid grid lines
@@ -51,8 +51,8 @@
fig = figure(figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
-r = npy.arange(0, 3.0, 0.01)
-theta = 2*npy.pi*r
+r = np.arange(0, 3.0, 0.01)
+theta = 2*np.pi*r
ax.plot(theta, r, color='#ee8d18', lw=3)
ax.set_rmax(2.0)
grid(True)
Modified: trunk/matplotlib/examples/pylab/polar_legend.py
===================================================================
--- trunk/matplotlib/examples/pylab/polar_legend.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/polar_legend.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import numpy as npy
+import numpy as np
from matplotlib.pyplot import figure, show, rc
# radar green, solid grid lines
@@ -12,8 +12,8 @@
fig = figure(figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
-r = npy.arange(0, 3.0, 0.01)
-theta = 2*npy.pi*r
+r = np.arange(0, 3.0, 0.01)
+theta = 2*np.pi*r
ax.plot(theta, r, color='#ee8d18', lw=3, label='a line')
ax.plot(0.5*theta, r, color='blue', ls='--', lw=3, label='another line')
ax.legend()
Modified: trunk/matplotlib/examples/pylab/quadmesh_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/quadmesh_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/quadmesh_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -6,23 +6,23 @@
This demo illustrates a bug in quadmesh with masked data.
"""
-import numpy as npy
+import numpy as np
from matplotlib.pyplot import figure, show, savefig
from matplotlib import cm, colors
from numpy import ma
n = 56
-x = npy.linspace(-1.5,1.5,n)
-y = npy.linspace(-1.5,1.5,n*2)
-X,Y = npy.meshgrid(x,y);
-Qx = npy.cos(Y) - npy.cos(X)
-Qz = npy.sin(Y) + npy.sin(X)
+x = np.linspace(-1.5,1.5,n)
+y = np.linspace(-1.5,1.5,n*2)
+X,Y = np.meshgrid(x,y);
+Qx = np.cos(Y) - np.cos(X)
+Qz = np.sin(Y) + np.sin(X)
Qx = (Qx + 1.1)
-Z = npy.sqrt(X**2 + Y**2)/5;
+Z = np.sqrt(X**2 + Y**2)/5;
Z = (Z - Z.min()) / (Z.max() - Z.min())
# The color array can include masked values:
-Zm = ma.masked_where(npy.fabs(Qz) < 0.5*npy.amax(Qz), Z)
+Zm = ma.masked_where(np.fabs(Qz) < 0.5*np.amax(Qz), Z)
fig = figure()
Modified: trunk/matplotlib/examples/pylab/step_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/step_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/step_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -1,9 +1,9 @@
-import numpy as npy
+import numpy as np
from numpy import ma
from matplotlib.pyplot import step, legend, xlim, ylim, show
-x = npy.arange(1, 7, 0.4)
-y0 = npy.sin(x)
+x = np.arange(1, 7, 0.4)
+y0 = np.sin(x)
y = y0.copy() + 2.5
step(x, y, label='pre (default)')
Modified: trunk/matplotlib/examples/pylab/strip_chart_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/strip_chart_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/strip_chart_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -12,7 +12,7 @@
import gobject, gtk
import matplotlib
matplotlib.use('GTKAgg')
-import numpy as npy
+import numpy as np
from matplotlib.lines import Line2D
@@ -36,9 +36,9 @@
def emitter(self, p=0.01):
'return a random value with probability p, else 0'
- v = npy.random.rand(1)
+ v = np.random.rand(1)
if v>p: return 0.
- else: return npy.random.rand(1)
+ else: return np.random.rand(1)
def update(self, *args):
if self.background is None: return True
Modified: trunk/matplotlib/examples/pylab/symlog_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/symlog_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/symlog_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -19,7 +19,7 @@
subplot(313)
-plot(x, npy.sin(x / 3.0))
+plot(x, np.sin(x / 3.0))
xscale('symlog')
yscale('symlog')
grid(True)
Modified: trunk/matplotlib/examples/pylab/webapp_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab/webapp_demo.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/pylab/webapp_demo.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -21,7 +21,7 @@
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib.figure import Figure
from matplotlib.cbook import iterable
-import numpy as npy
+import numpy as np
def make_fig():
"""
@@ -40,9 +40,9 @@
line, = ax.plot([1,2,3], 'ro--', markersize=12, markerfacecolor='g')
# make a translucent scatter collection
- x = npy.random.rand(100)
- y = npy.random.rand(100)
- area = npy.pi*(10 * npy.random.rand(100))**2 # 0 to 10 point radiuses
+ x = np.random.rand(100)
+ y = np.random.rand(100)
+ area = np.pi*(10 * np.random.rand(100))**2 # 0 to 10 point radiuses
c = ax.scatter(x,y,area)
c.set_alpha(0.5)
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-05-16 22:26:15 UTC (rev 5164)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-05-16 22:47:00 UTC (rev 5165)
@@ -181,7 +181,7 @@
line_lstrip = line.lstrip()
if (line_lstrip.startswith('from __future__ import division') or
line_lstrip.startswith('matplotlib.use') or
- line_lstrip.find('savefig')>=0 or
+ line_lstrip.startswith('savefig') or
line_lstrip.startswith('show')):
continue
tmpfile.write(line)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 22:26:17
|
Revision: 5164
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5164&view=rev
Author: jdh2358
Date: 2008-05-16 15:26:15 -0700 (Fri, 16 May 2008)
Log Message:
-----------
removed pre py2.4 compatability code and some other dead code
Modified Paths:
--------------
trunk/matplotlib/API_CHANGES
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/_cm.py
trunk/matplotlib/lib/matplotlib/axis.py
trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
trunk/matplotlib/lib/matplotlib/backends/backend_emf.py
trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
trunk/matplotlib/lib/matplotlib/backends/backend_template.py
trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
trunk/matplotlib/lib/matplotlib/cbook.py
trunk/matplotlib/lib/matplotlib/figure.py
trunk/matplotlib/lib/matplotlib/pylab.py
trunk/matplotlib/lib/matplotlib/text.py
Removed Paths:
-------------
trunk/matplotlib/lib/subprocess/
Modified: trunk/matplotlib/API_CHANGES
===================================================================
--- trunk/matplotlib/API_CHANGES 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/API_CHANGES 2008-05-16 22:26:15 UTC (rev 5164)
@@ -1,3 +1,6 @@
+ matplotlib now requires python2.4, so matplotlib.cbook will no
+ loner provide set, enumerate, reversed or izip compatability functions
+
In numpy 1.0 bins are specified by the left edges only. The axes
method "hist" now uses future numpy 1.3 semantic for histograms.
Providing binedges, the last value gives the upper-right edge now,
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/CHANGELOG 2008-05-16 22:26:15 UTC (rev 5164)
@@ -1,5 +1,11 @@
-2008-05-16 Reorganized examples dir
+2008-05-16 removed some unneeded code w/ the python 2.4 requirement.
+ cbook no longer provides compatibility for reversed,
+ enumerate, set or izip. removed lib/subprocess, mpl1,
+ sandbox/units, and the swig code. This stuff should remain
+ on the maintenance branch for archival purposes. JDH
+2008-05-16 Reorganized examples dir - JDH
+
2008-05-16 Added 'elinewidth' keyword arg to errorbar, based on patch
by Christopher Brown - MM
Modified: trunk/matplotlib/lib/matplotlib/_cm.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/_cm.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/_cm.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -11,7 +11,6 @@
import matplotlib as mpl
import matplotlib.colors as colors
-from matplotlib.cbook import reversed
LUTSIZE = mpl.rcParams['image.lut']
_binary_data = {
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/axis.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -4,7 +4,7 @@
from __future__ import division
from artist import Artist, setp
-from cbook import enumerate, silent_list, popall, CallbackRegistry
+from cbook import silent_list, popall, CallbackRegistry
from lines import Line2D, TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN
from matplotlib import rcParams
from patches import bbox_artist
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -31,8 +31,7 @@
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import RendererBase,\
GraphicsContextBase, FigureManagerBase, FigureCanvasBase
-from matplotlib.cbook import enumerate, is_string_like, exception_to_str, \
- maxdict
+from matplotlib.cbook import is_string_like, exception_to_str, maxdict
from matplotlib.figure import Figure
from matplotlib.font_manager import findfont
from matplotlib.ft2font import FT2Font, LOAD_FORCE_AUTOHINT
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -36,7 +36,7 @@
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase
-from matplotlib.cbook import enumerate, izip, is_string_like
+from matplotlib.cbook import is_string_like
from matplotlib.figure import Figure
from matplotlib.mathtext import MathTextParser
from matplotlib.path import Path
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_emf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_emf.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_emf.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -17,7 +17,6 @@
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase
-from matplotlib.cbook import enumerate
from matplotlib.figure import Figure
from matplotlib.transforms import Bbox
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -20,7 +20,7 @@
import matplotlib
from matplotlib import rcParams, verbose
-from matplotlib.cbook import is_string_like, enumerate
+from matplotlib.cbook import is_string_like
from matplotlib.backend_bases import \
RendererBase, GraphicsContextBase, FigureManagerBase, FigureCanvasBase,\
NavigationToolbar2, cursors
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -22,7 +22,7 @@
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase
-from matplotlib.cbook import is_string_like, enumerate
+from matplotlib.cbook import is_string_like
from matplotlib.figure import Figure
from matplotlib.mathtext import MathTextParser
from matplotlib.transforms import Affine2D
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -19,7 +19,7 @@
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
-from matplotlib.cbook import is_string_like, is_writable_file_like, enumerate
+from matplotlib.cbook import is_string_like, is_writable_file_like
from matplotlib.colors import colorConverter
from matplotlib.figure import Figure
from matplotlib.widgets import SubplotTool
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -25,7 +25,7 @@
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase
from matplotlib.backends.backend_mixed import MixedModeRenderer
-from matplotlib.cbook import Bunch, enumerate, is_string_like, reverse_dict, \
+from matplotlib.cbook import Bunch, is_string_like, reverse_dict, \
get_realpath_and_stat, is_writable_file_like, maxdict
from matplotlib.figure import Figure
from matplotlib.font_manager import findfont, is_opentype_cff_font
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -14,7 +14,7 @@
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase
-from matplotlib.cbook import is_string_like, izip, get_realpath_and_stat, \
+from matplotlib.cbook import is_string_like, get_realpath_and_stat, \
is_writable_file_like, maxdict
from matplotlib.figure import Figure
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -5,7 +5,7 @@
import matplotlib
from matplotlib import verbose
-from matplotlib.cbook import is_string_like, enumerate, onetrue
+from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
from matplotlib._pylab_helpers import Gcf
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -5,7 +5,7 @@
import matplotlib
from matplotlib import verbose
-from matplotlib.cbook import is_string_like, enumerate, onetrue
+from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
from matplotlib._pylab_helpers import Gcf
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -6,7 +6,6 @@
import os, sys
import matplotlib
from matplotlib import verbose
-from matplotlib.cbook import enumerate
from matplotlib.figure import Figure
from backend_agg import FigureCanvasAgg
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_template.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_template.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_template.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -49,7 +49,6 @@
from matplotlib._pylab_helpers import Gcf
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
FigureManagerBase, FigureCanvasBase
-from matplotlib.cbook import enumerate
from matplotlib.figure import Figure
from matplotlib.transforms import Bbox
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -11,7 +11,7 @@
import os.path
import matplotlib
-from matplotlib.cbook import is_string_like, enumerate
+from matplotlib.cbook import is_string_like
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, cursors
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -7,11 +7,6 @@
import time, datetime
import numpy as np
-try:
- set = set
-except NameError:
- from sets import Set as set
-
major, minor1, minor2, s, tmp = sys.version_info
@@ -462,47 +457,7 @@
return self.data[i % len(self.data)]
-# use enumerate builtin if available, else use python version
-try:
- import __builtin__
- enumerate = __builtin__.enumerate
-except:
- def enumerate(seq):
- """Python equivalent to the enumerate builtin function
- enumerate() is new in Python 2.3
- """
- for i in range(len(seq)):
- yield i, seq[i]
-
-# use reversed builtin if available, else use python version
-try:
- import __builtin__
- reversed = __builtin__.reversed
-except:
- def reversed(seq):
- """Python equivalent to the enumerate builtin function
- enumerate() is new in Python 2.3
- """
- for i in range(len(seq)-1,-1,-1):
- yield seq[i]
-
-
-# use itertools.izip if available, else use python version
-try:
- import itertools
- izip = itertools.izip
-except:
- def izip(*iterables):
- """Python equivalent to itertools.izip
- itertools module - new in Python 2.3
- """
- iterables = map(iter, iterables)
- while iterables:
- result = [i.next() for i in iterables]
- yield tuple(result)
-
-
def get_split_ind(seq, N):
"""seq is a list of words. Return the index into seq such that
len(' '.join(seq[:ind])<=N
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -7,7 +7,7 @@
import artist
from artist import Artist
from axes import Axes, SubplotBase, subplot_class_factory
-from cbook import flatten, allequal, Stack, iterable, dedent, set
+from cbook import flatten, allequal, Stack, iterable, dedent
import _image
import colorbar as cbar
from image import FigureImage
Modified: trunk/matplotlib/lib/matplotlib/pylab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pylab.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/pylab.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -195,7 +195,7 @@
import sys, warnings
from cbook import flatten, is_string_like, exception_to_str, popd, \
- silent_list, iterable, enumerate, dedent
+ silent_list, iterable, dedent
import numpy as np
from numpy import ma
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-05-16 21:58:39 UTC (rev 5163)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-05-16 22:26:15 UTC (rev 5164)
@@ -10,7 +10,7 @@
from matplotlib import rcParams
import artist
from artist import Artist
-from cbook import enumerate, is_string_like, maxdict
+from cbook import is_string_like, maxdict
from font_manager import FontProperties
from patches import bbox_artist, YAArrow
from transforms import Affine2D, Bbox
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 21:58:47
|
Revision: 5163
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5163&view=rev
Author: jdh2358
Date: 2008-05-16 14:58:39 -0700 (Fri, 16 May 2008)
Log Message:
-----------
purged some dead code dirs; these can live in the maint branch
Removed Paths:
-------------
trunk/matplotlib/makeswig.py
trunk/matplotlib/mpl1/
trunk/matplotlib/sandbox/units/
trunk/matplotlib/swig/
Deleted: trunk/matplotlib/makeswig.py
===================================================================
--- trunk/matplotlib/makeswig.py 2008-05-16 21:01:39 UTC (rev 5162)
+++ trunk/matplotlib/makeswig.py 2008-05-16 21:58:39 UTC (rev 5163)
@@ -1,23 +0,0 @@
-"""
-requires swig cvs as of 2005-02-24
-"""
-import os, sys
-wrap = (
- 'agg',
- )
-#SWIG = 'swig'
-SWIG = '/home/titan/johnh/dev/bin/swig'
-AGGINCLUDE = 'agg23/include'
-
-swigit = '%(SWIG)s -python -c++ -outdir lib/matplotlib -o src/%(SWIGFILE)s.cxx -I%(AGGINCLUDE)s swig/%(SWIGFILE)s.i '
-
-
-os.system('%(SWIG)s -python -external-runtime src/swig_runtime.h'%locals())
-for SWIGFILE in wrap:
- command = swigit%locals()
- print 'swigging %s'%SWIGFILE
- print command
- os.system(command)
-
-
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-16 21:01:55
|
Revision: 5162
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5162&view=rev
Author: jdh2358
Date: 2008-05-16 14:01:39 -0700 (Fri, 16 May 2008)
Log Message:
-----------
minor backend driver cleanup
Modified Paths:
--------------
trunk/matplotlib/examples/pylab/broken_barh.py
trunk/matplotlib/examples/tests/backend_driver.py
Modified: trunk/matplotlib/examples/pylab/broken_barh.py
===================================================================
--- trunk/matplotlib/examples/pylab/broken_barh.py 2008-05-16 20:47:09 UTC (rev 5161)
+++ trunk/matplotlib/examples/pylab/broken_barh.py 2008-05-16 21:01:39 UTC (rev 5162)
@@ -21,5 +21,5 @@
fontsize=16,
horizontalalignment='right', verticalalignment='top')
-fig.savefig('broken_barh', dpi=100)
+#fig.savefig('broken_barh', dpi=100)
show()
Modified: trunk/matplotlib/examples/tests/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/tests/backend_driver.py 2008-05-16 20:47:09 UTC (rev 5161)
+++ trunk/matplotlib/examples/tests/backend_driver.py 2008-05-16 21:01:39 UTC (rev 5162)
@@ -181,7 +181,7 @@
line_lstrip = line.lstrip()
if (line_lstrip.startswith('from __future__ import division') or
line_lstrip.startswith('matplotlib.use') or
- line_lstrip.startswith('savefig') or
+ line_lstrip.find('savefig')>=0 or
line_lstrip.startswith('show')):
continue
tmpfile.write(line)
@@ -202,6 +202,12 @@
if __name__ == '__main__':
times = {}
default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template']
+ if len(sys.argv)==2 and sys.argv[1]=='--clean':
+ for b in default_backends:
+ # todo: implement python recursive remove
+ os.system('rm -rf %s'%b)
+ print 'all clean...'
+ raise SystemExit
if '--coverage' in sys.argv:
python = ['coverage.py', '-x']
sys.argv.remove('--coverage')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|