SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

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

Showing results of 5455

<< < 1 .. 215 216 217 218 219 > >> (Page 217 of 219)
From: <jd...@us...> - 2007年07月20日 13:44:13
Revision: 3586
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3586&view=rev
Author: jdh2358
Date: 2007年07月20日 06:44:10 -0700 (2007年7月20日)
Log Message:
-----------
traits cleanup
Modified Paths:
--------------
 trunk/matplotlib/mpl1/mpl1.py
 trunk/matplotlib/mpl1/test.py
Removed Paths:
-------------
 trunk/matplotlib/mpl1/mtraits.py
Modified: trunk/matplotlib/mpl1/mpl1.py
===================================================================
--- trunk/matplotlib/mpl1/mpl1.py	2007年07月20日 13:21:42 UTC (rev 3585)
+++ trunk/matplotlib/mpl1/mpl1.py	2007年07月20日 13:44:10 UTC (rev 3586)
@@ -2,9 +2,57 @@
 import enthought.traits.api as traits
 
 from matplotlib import agg
+from matplotlib import colors as mcolors
 import numpy as npy
 
-import mtraits # some handy traits for mpl
+
+class ColorHandler(traits.TraitHandler):
+ is_mapped = True
+
+ def post_setattr(self, object, name, value):
+ object.__dict__[ name + '_' ] = self.mapped_value( value )
+
+ def mapped_value(self, value ):
+ if value is None: return None
+ return mcolors.colorConverter.to_rgba(value)
+ 
+ 
+ def validate(self, object, name, value):
+ try:
+ self.mapped_value(value)
+ except ValueError:
+ return self.error(object, name, value)
+ else: 
+ return value
+
+ def info(self):
+ return """\
+any valid matplotlib color, eg an abbreviation like 'r' for red, a full
+name like 'orange', a hex color like '#efefef', a grayscale intensity
+like '0.5', or an RGBA tuple (1,0,0,1)"""
+
+class MTraitsNamespace:
+ DPI = traits.Float(72.)
+ Affine = traits.Array('d', (3,3), npy.array([[1,0,0],[0,1,0],[0,0,1]], npy.float_))
+ Alpha = traits.Range(0., 1., 0.)
+ AntiAliased = traits.true
+ Codes = traits.Array('b', value=npy.array([0,0], dtype=npy.uint8))
+ Color = traits.Trait('black', ColorHandler())
+ DPI = traits.Float(72.)
+ Interval = traits.Array('d', (2,), npy.array([0.0, 1.0], npy.float_))
+ LineStyle = traits.Trait('-', '--', '-.', ':', 'steps', None)
+ LineWidth = traits.Float(1.0)
+ Marker = traits.Trait(None, '.', ',', 'o', '^', 'v', '<', '>', 's',
+ '+', 'x', 'd', 'D', '|', '_', 'h', 'H',
+ 'p', '1', '2', '3', '4')
+ MarkerSize = traits.Float(6)
+ Verts = traits.Array('d', value=npy.array([[0,0],[0,0]], npy.float_))
+ PathData = traits.Tuple(Codes, Verts)
+ Visible = traits.true
+
+
+mtraits = MTraitsNamespace()
+
 
 def affine_axes(rect):
 'make an affine for a typical l,b,w,h axes rectangle'
@@ -35,7 +83,7 @@
 dtype=npy.float_)
 
 
-class Renderer:
+class Renderer(traits.HasTraits):
 dpi = traits.Float(72.)
 
 def __init__(self, width, height):
@@ -161,7 +209,7 @@
 Locs = npy.dot(affineverts, Locs)
 
 
- dpiscale = 1.0 # self.dpi/72. # for some reason this is broken 
+ dpiscale = self.dpi/72. # for some reason this is broken 
 # this will need to be highly optimized and hooked into some
 # extension code using cached marker rasters as we now do in
 # _backend_agg
@@ -210,15 +258,16 @@
 class Func(traits.HasTraits):
 def __call__(self, X):
 'transform the numpy array with shape N,2'
- raise NotImplementedError
+ return X
 
 def invert(self, x, y):
 'invert the point x, y'
- raise NotImplementedError
+ return x, y
 
 def point(self, x, y):
 'transform the point x, y'
- raise NotImplementedError
+ return x, y
+ 
 
 class Identity(Func):
 def __call__(self, X):
@@ -252,7 +301,7 @@
 raise NotImplementedError
 
 
-mtraits.Model = traits.Trait(None, Identity, Polar)
+mtraits.Model = traits.Instance(Func, ())
 
 
 
@@ -268,7 +317,7 @@
 fillcolor = mtraits.Color('blue')
 alpha = mtraits.Alpha(1.0)
 linewidth = mtraits.LineWidth(1.0)
- antialiased = mtraits.FlexibleTrueTrait()
+ antialiased = mtraits.AntiAliased
 pathdata = mtraits.PathData()
 affine = mtraits.Affine()
 
@@ -309,8 +358,8 @@
 # hmm, I would have thought these would be called by the attr
 # setting above
 self._pathdata_changed(None, self.pathdata)
- self._fillcolor_changed(None, self.fillcolor)
- self._strokecolor_changed(None, self.strokecolor) 
+ self._fillcolor__changed(None, self.fillcolor_)
+ self._strokecolor__changed(None, self.strokecolor_) 
 
 
 @staticmethod
@@ -334,10 +383,10 @@
 self.agg_path = AggPath.make_agg_path(newdata)
 
 
- def _fillcolor_changed(self, oldcolor, newcolor): 
+ def _fillcolor__changed(self, oldcolor, newcolor): 
 self.agg_fillcolor = self.color_to_rgba8(newcolor)
 
- def _strokecolor_changed(self, oldcolor, newcolor): 
+ def _strokecolor__changed(self, oldcolor, newcolor): 
 
 c = self.color_to_rgba8(newcolor)
 self.agg_strokecolor = c
@@ -345,7 +394,7 @@
 
 def color_to_rgba8(self, color):
 if color is None: return None
- rgba = [int(255*c) for c in color.r, color.g, color.b, color.a]
+ rgba = [int(255*c) for c in color]
 return agg.rgba8(*rgba)
 
 class Markers(traits.HasTraits):
@@ -405,8 +454,8 @@
 
 class Artist(traits.HasTraits):
 zorder = traits.Float(1.0)
- alpha = mtraits.Alpha(1.0)
- visible = mtraits.FlexibleTrueTrait()
+ alpha = mtraits.Alpha()
+ visible = mtraits.Visible()
 affine = mtraits.Affine()
 
 def __init__(self):
@@ -427,7 +476,7 @@
 class Line(Artist):
 
 linestyle = mtraits.LineStyle('-')
- antialiased = mtraits.FlexibleTrueTrait(True)
+ antialiased = mtraits.AntiAliased()
 color = mtraits.Color('blue')
 linewidth = mtraits.LineWidth(1.0) 
 marker = mtraits.Marker(None)
Deleted: trunk/matplotlib/mpl1/mtraits.py
===================================================================
--- trunk/matplotlib/mpl1/mtraits.py	2007年07月20日 13:21:42 UTC (rev 3585)
+++ trunk/matplotlib/mpl1/mtraits.py	2007年07月20日 13:44:10 UTC (rev 3586)
@@ -1,135 +0,0 @@
-"""
-Install instructions for traits 2.0
-
- # blow away old enthought
- rm -rf ~/dev/lib/python2.4/site-packages/enthought.*
-
- # get easy_install, if necessary
- wget http://peak.telecommunity.com/dist/ez_setup.py
- sudo python sez_setup.py
-
- sudo easy_install -f http://code.enthought.com/enstaller/eggs/source/unstable "enthought.etsconfig < 3.0a" "enthought.util <3.0a" "enthought.debug <3.0a"
-
- svn co https://svn.enthought.com/svn/enthought/branches/enthought.traits_2.0 enthought_traits
-
- cd enthought_traits/
- sudo python setup.py install 
-
-
-"""
-# Here is some example code showing how to define some representative
-# rc properties and construct a matplotlib artist using traits.
-# Because matplotlib ships with enthought traits already, you can run
-# this script with just matplotlib. Unfortunately, we do not ship the
-# ex UI component so you can't test that part. I'm a bit of a traits
-# newbie so there are probably better ways to do what I have done
-# below.
-
-import sys, os, re
-import enthought.traits.api as traits
-from matplotlib.cbook import is_string_like
-from matplotlib import colors as mcolors
-import numpy as npy
-
-doprint = True
-FlexibleTrueTrait = traits.Trait(
- True,
- { 'true': True, 't': True, 'yes': True, 'y': True, 'on': True, True: True,
- 'false': False, 'f': False, 'no': False, 'n': False, 'off': False, False: False
- } )
-FlexibleFalseTrait = traits.Trait( False, FlexibleTrueTrait )
-
-colors = mcolors.cnames
-
-def hex2color(s):
- "Convert hex string (like html uses, eg, #efefef) to a r,g,b tuple"
- return tuple([int(n, 16)/255.0 for n in (s[1:3], s[3:5], s[5:7])])
-
-def color_converter(x):
- return mcolors.colorConverter(x)
-class RGBA(traits.HasTraits):
- # r,g,b,a in the range 0-1 with default color 0,0,0,1 (black)
- r = traits.Range(0., 1., 0.)
- g = traits.Range(0., 1., 0.)
- b = traits.Range(0., 1., 0.)
- a = traits.Range(0., 1., 1.)
- def __init__(self, r=0., g=0., b=0., a=1.):
- self.r = r
- self.g = g
- self.b = b
- self.a = a
-
- def __repr__(self):
- return '(%1.2f, %1.2f, %1.2f, %1.2f)'%(self.r, self.g, self.b, self.a)
-
-def tuple_to_rgba(ob, name, val):
- tup = [float(x) for x in val]
- if len(tup)==3:
- r,g,b = tup
- return RGBA(r,g,b)
- elif len(tup)==4:
- r,g,b,a = tup
- return RGBA(r,g,b,a)
- else:
- raise ValueError
-tuple_to_rgba.info = 'a RGB or RGBA tuple of floats'
-
-def hex_to_rgba(ob, name, val):
- rgx = re.compile('^#[0-9A-Fa-f]{6}$')
-
- if not is_string_like(val):
- raise TypeError
- if rgx.match(val) is None:
- raise ValueError
- r,g,b = hex2color(val)
- return RGBA(r,g,b,1.0)
-hex_to_rgba.info = 'a hex color string'
-
-def colorname_to_rgba(ob, name, val):
- hex = colors[val.lower()]
- r,g,b = hex2color(hex)
- return RGBA(r,g,b,1.0)
-colorname_to_rgba.info = 'a named color'
-
-def float_to_rgba(ob, name, val):
- val = float(val)
- return RGBA(val, val, val, 1.)
-float_to_rgba.info = 'a grayscale intensity'
-
-
-
-def file_exists(ob, name, val):
- fh = file(val, 'r')
- return val
-
-def path_exists(ob, name, val):
- os.path.exists(val)
-linestyles = ('-', '--', '-.', ':', 'steps', None)
-TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN = range(4)
-linemarkers = (None, '.', ',', 'o', '^', 'v', '<', '>', 's',
- '+', 'x', 'd', 'D', '|', '_', 'h', 'H',
- 'p', '1', '2', '3', '4',
- TICKLEFT,
- TICKRIGHT,
- TICKUP,
- TICKDOWN,
- )
- 
-colorfuncs = RGBA(), float_to_rgba, colorname_to_rgba, RGBA, hex_to_rgba, tuple_to_rgba, None
-
-Affine = traits.Array('d', (3,3), npy.array([[1,0,0],[0,1,0],[0,0,1]], npy.float_))
-Alpha = traits.Float(1.0)
-Alpha = traits.Range(0., 1., 0.)
-Antialiased = FlexibleTrueTrait
-Codes = traits.Array('b', value=npy.array([0,0], dtype=npy.uint8))
-Color = traits.Trait(*colorfuncs)
-DPI = traits.Float(72.)
-Interval = traits.Array('d', (2,), npy.array([0.0, 1.0], npy.float_))
-LineStyle = traits.Trait(*linestyles)
-LineWidth = traits.Float(0.5)
-Marker = traits.Trait(*linemarkers)
-MarkerSize = traits.Float(6)
-Verts = traits.Array('d', value=npy.array([[0,0],[0,0]], npy.float_))
-PathData = traits.Tuple(Codes, Verts)
-
-
Modified: trunk/matplotlib/mpl1/test.py
===================================================================
--- trunk/matplotlib/mpl1/test.py	2007年07月20日 13:21:42 UTC (rev 3585)
+++ trunk/matplotlib/mpl1/test.py	2007年07月20日 13:44:10 UTC (rev 3586)
@@ -1,50 +1,19 @@
-import numpy as npy
-import enthought.traits.api as traits
+from enthought.traits.api import *
 
+def Alias(name):
+ return Property(lambda obj: getattr(obj, name),
+ lambda obj, val: setattr(obj, name, val))
 
-class C(traits.HasTraits):
- x = traits.Float(0.0)
- y = traits.Float(1.0)
+class Path(HasTraits):
+ strokecolor = Color()
 
-class MyC(C):
- xy = traits.Float(0.0)
 
- def __init__(self, c):
- self.x = c.x
- self.y = c.y
+class Line(Path):
+ color = Alias('strokecolor')
 
- c.sync_trait('x', self)
- c.sync_trait('y', self)
-
- def _x_changed(self, old, new):
- self.xy = self.x * self.y
-
- def _y_changed(self, old, new):
- self.xy = self.x * self.y
-
-
-# C objects are created at top level
-c = C()
-c.x = 1
-c.y = 1
-
-
-
-
-
-class Backend:
- 
- def register_c(self, c):
- # only gets C objects after creation
- self.myc = MyC(c)
-
-backend = Backend()
-
-backend.register_c(c)
-
-c.x = 4
-
-print backend.myc.xy
-
-
- 
+ def __init__(self, x, color='red'):
+ self.x = x
+ self.color = color
+ 
+line = Line(1)
+print line.strokecolor
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3585
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3585&view=rev
Author: pkienzle
Date: 2007年07月20日 06:21:42 -0700 (2007年7月20日)
Log Message:
-----------
Fix concatenate bug in contains() method
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/lines.py
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py	2007年07月20日 08:56:16 UTC (rev 3584)
+++ trunk/matplotlib/lib/matplotlib/lines.py	2007年07月20日 13:21:42 UTC (rev 3585)
@@ -103,8 +103,10 @@
 line_hits = (cx-px)**2 + (cy-py)**2 <= radius**2
 #if any(line_hits): print "lines",xr[candidates]
 line_hits = line_hits & candidates
- result = concatenate((nonzero(point_hits),nonzero(line_hits)))
- return result
+ points, = point_hits.ravel().nonzero()
+ lines, = line_hits.ravel().nonzero()
+ #print points,lines
+ return concatenate((points,lines))
 
 class Line2D(Artist):
 lineStyles = _lineStyles = { # hidden names deprecated
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3584
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3584&view=rev
Author: efiring
Date: 2007年07月20日 01:56:16 -0700 (2007年7月20日)
Log Message:
-----------
Revert numerix to 3573, second try
Added Paths:
-----------
 trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py
 trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py
 trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py
 trunk/matplotlib/lib/matplotlib/numerix/fft/
 trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/
 trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/ma/
 trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/mlab/
 trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore
 trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/npyma/
 trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/random_array/
 trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py
Removed Paths:
-------------
 trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/fft.py
 trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py
 trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/ma.py
 trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore
 trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/mlab.py
 trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/npyma.py
 trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py
 trunk/matplotlib/lib/matplotlib/numerix/random_array.py
Copied: trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,76 @@
+"""Imports from numarray for numerix, the numarray/Numeric interchangeability
+module. These array functions are used when numarray is chosen.
+"""
+from numarray import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
+ Float32, Float64, Complex32, Complex64, Float, Int, Complex,\
+ typecode
+import numarray.ieeespecial as _ieee
+inf = infinity = infty = Infinity = _ieee.inf
+isnan = _ieee.isnan
+
+class _TypeNamespace:
+ """Numeric compatible type aliases for use with extension functions."""
+ Int8 = typecode[Int8]
+ UInt8 = typecode[UInt8]
+ Int16 = typecode[Int16]
+ UInt16 = typecode[UInt16]
+ Int32 = typecode[Int32]
+ #UInt32 = typecode[UInt32] # Todd: this appears broken
+ Float32 = typecode[Float32]
+ Float64 = typecode[Float64]
+ Complex32 = typecode[Complex32]
+ Complex64 = typecode[Complex64]
+
+nx = _TypeNamespace()
+
+from numarray import asarray, dot, fromlist, NumArray, shape, alltrue
+from numarray import all as _all
+
+def all(a, axis=None):
+ '''Numpy-compatible version of all()'''
+ if axis is None:
+ return _all(a)
+ return alltrue(a, axis)
+
+class _Matrix(NumArray):
+ """_Matrix is a ported, stripped down version of the Numeric Matrix
+ class which supplies only matrix multiplication.
+ """
+ def _rc(self, a):
+ if len(shape(a)) == 0:
+ return a
+ else:
+ return Matrix(a)
+
+ def __mul__(self, other):
+ aother = asarray(other)
+ #if len(aother.shape) == 0:
+ # return self._rc(self*aother)
+ #else:
+ # return self._rc(dot(self, aother))
+ #return self._rc(dot(self, aother))
+ return dot(self, aother)
+
+ def __rmul__(self, other):
+ aother = asarray(other)
+ if len(aother.shape) == 0:
+ return self._rc(aother*self)
+ else:
+ return self._rc(dot(aother, self))
+
+ def __imul__(self,other):
+ aother = asarray(other)
+ self[:] = dot(self, aother)
+ return self
+
+def Matrix(data, typecode=None, copy=1, savespace=0):
+ """Matrix constructs new matrices from 2D nested lists of numbers"""
+ if isinstance(data, type("")):
+ raise TypeError("numerix Matrix does not support Numeric matrix string notation. Use nested lists.")
+ a = fromlist(data, type=typecode)
+ if a.rank == 0:
+ a.shape = (1,1)
+ elif a.rank == 1:
+ a.shape = (1,) + a.shape
+ a.__class__ = _Matrix
+ return a
Copied: trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,42 @@
+from Numeric import array, ravel, reshape, shape, alltrue, sometrue
+from Numeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
+ Float32, Float64, Complex32, Complex64, Float, Int, Complex
+from numpy import isnan as _isnan
+
+class _TypeNamespace:
+ """Numeric compatible type aliases for use with extension functions."""
+ Int8 = Int8
+ UInt8 = UInt8
+ Int16 = Int16
+ UInt16 = UInt16
+ Int32 = Int32
+ UInt32 = UInt32
+ Float32 = Float32
+ Float64 = Float64
+ Complex32 = Complex32
+ Complex64 = Complex64
+
+nx = _TypeNamespace()
+
+def isnan(a):
+ """y = isnan(x) returns True where x is Not-A-Number"""
+ return reshape(array([_isnan(i) for i in ravel(a)],'b'), shape(a))
+
+def all(a, axis=None):
+ '''Numpy-compatible version of all()'''
+ if axis is None:
+ return alltrue(ravel(a))
+ else:
+ return alltrue(a, axis)
+
+def any(a, axis=None):
+ if axis is None:
+ return sometrue(ravel(a))
+ else:
+ return sometrue(a, axis)
+
+
+# inf is useful for testing infinities in results of array divisions
+# (which don't raise exceptions)
+
+inf = infty = infinity = Infinity = (array([1])/0.0)[0]
Copied: trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,34 @@
+try:
+ from numpy.oldnumeric import Int8, UInt8, \
+ Int16, UInt16, \
+ Int32, UInt32, \
+ Float32, Float64, \
+ Complex32, Complex64, \
+ Float, Int, Complex
+except ImportError:
+ from numpy import Int8, UInt8, \
+ Int16, UInt16, \
+ Int32, UInt32, \
+ Float32, Float64, \
+ Complex32, Complex64, \
+ Float, Int, Complex
+
+class _TypeNamespace:
+ """Numeric compatible type aliases for use with extension functions."""
+ Int8 = Int8
+ UInt8 = UInt8
+ Int16 = Int16
+ UInt16 = UInt16
+ Int32 = Int32
+ UInt32 = UInt32
+ Float32 = Float32
+ Float64 = Float64
+ Complex32 = Complex32
+ Complex64 = Complex64
+
+nx = _TypeNamespace()
+
+from numpy import inf, infty, Infinity
+from numpy.random import rand, randn
+infinity = Infinity
+from numpy import all, isnan, any
Copied: trunk/matplotlib/lib/matplotlib/numerix/fft (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/fft)
Deleted: trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,13 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.fft import *
-elif which[0] == "numeric":
- from FFT import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.fft import *
- except ImportError:
- from numpy.dft.old import *
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,13 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.fft import *
+elif which[0] == "numeric":
+ from FFT import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.fft import *
+ except ImportError:
+ from numpy.dft.old import *
+else:
+ raise RuntimeError("invalid numerix selector")
Deleted: trunk/matplotlib/lib/matplotlib/numerix/fft.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/fft.py	2007年07月20日 08:49:00 UTC (rev 3583)
+++ trunk/matplotlib/lib/matplotlib/numerix/fft.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1 +0,0 @@
-from numpy.oldnumeric.fft import *
Copied: trunk/matplotlib/lib/matplotlib/numerix/linear_algebra (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/linear_algebra)
Deleted: trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,13 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.linear_algebra import *
-elif which[0] == "numeric":
- from LinearAlgebra import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.linear_algebra import *
- except ImportError:
- from numpy.linalg.old import *
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,13 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.linear_algebra import *
+elif which[0] == "numeric":
+ from LinearAlgebra import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.linear_algebra import *
+ except ImportError:
+ from numpy.linalg.old import *
+else:
+ raise RuntimeError("invalid numerix selector")
Deleted: trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py	2007年07月20日 08:49:00 UTC (rev 3583)
+++ trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1 +0,0 @@
-from numpy.oldnumeric.linear_algebra import *
Copied: trunk/matplotlib/lib/matplotlib/numerix/ma (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/ma)
Deleted: trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,24 +0,0 @@
-from matplotlib.numerix import which, use_maskedarray
-
-if which[0] == "numarray":
- from numarray.ma import *
- nomask = None
- getmaskorNone = getmask
-elif which[0] == "numeric":
- from MA import *
- nomask = None
- getmaskorNone = getmask
-elif which[0] == "numpy":
- if use_maskedarray:
- from maskedarray import *
- print "using maskedarray"
- else:
- from numpy.core.ma import *
- #print "using ma"
- def getmaskorNone(obj):
- _msk = getmask(obj)
- if _msk is nomask:
- return None
- return _msk
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,24 @@
+from matplotlib.numerix import which, use_maskedarray
+
+if which[0] == "numarray":
+ from numarray.ma import *
+ nomask = None
+ getmaskorNone = getmask
+elif which[0] == "numeric":
+ from MA import *
+ nomask = None
+ getmaskorNone = getmask
+elif which[0] == "numpy":
+ if use_maskedarray:
+ from maskedarray import *
+ print "using maskedarray"
+ else:
+ from numpy.core.ma import *
+ #print "using ma"
+ def getmaskorNone(obj):
+ _msk = getmask(obj)
+ if _msk is nomask:
+ return None
+ return _msk
+else:
+ raise RuntimeError("invalid numerix selector")
Deleted: trunk/matplotlib/lib/matplotlib/numerix/ma.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/ma.py	2007年07月20日 08:49:00 UTC (rev 3583)
+++ trunk/matplotlib/lib/matplotlib/numerix/ma.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,16 +0,0 @@
-from matplotlib.numerix import use_maskedarray
-
-from numpy.core.ma import *
-
-if use_maskedarray:
- from maskedarray import *
- print "using maskedarray"
-else:
- from numpy.core.ma import *
- #print "using ma"
-
-def getmaskorNone(obj):
- _msk = getmask(obj)
- if _msk is nomask:
- return None
- return _msk
Copied: trunk/matplotlib/lib/matplotlib/numerix/mlab (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/mlab)
Property changes on: trunk/matplotlib/lib/matplotlib/numerix/mlab
___________________________________________________________________
Name: svn:ignore
 + *.pyc
Deleted: trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1 +0,0 @@
-*.pyc
Copied: trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1 @@
+*.pyc
Deleted: trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,16 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.linear_algebra.mlab import *
-elif which[0] == "numeric":
- from MLab import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.mlab import *
- except ImportError:
- from numpy.lib.mlab import *
-else:
- raise RuntimeError("invalid numerix selector")
-
-amin = min
-amax = max
Copied: trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,16 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.linear_algebra.mlab import *
+elif which[0] == "numeric":
+ from MLab import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.mlab import *
+ except ImportError:
+ from numpy.lib.mlab import *
+else:
+ raise RuntimeError("invalid numerix selector")
+
+amin = min
+amax = max
Deleted: trunk/matplotlib/lib/matplotlib/numerix/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab.py	2007年07月20日 08:49:00 UTC (rev 3583)
+++ trunk/matplotlib/lib/matplotlib/numerix/mlab.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,4 +0,0 @@
-from numpy.oldnumeric.mlab import *
-
-amin = min
-amax = max
Copied: trunk/matplotlib/lib/matplotlib/numerix/npyma (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/npyma)
Deleted: trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,8 +0,0 @@
-from matplotlib.numerix import use_maskedarray
-
-if use_maskedarray:
- from maskedarray import *
- print "using maskedarray"
-else:
- from numpy.core.ma import *
- #print "using ma"
Copied: trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,8 @@
+from matplotlib.numerix import use_maskedarray
+
+if use_maskedarray:
+ from maskedarray import *
+ print "using maskedarray"
+else:
+ from numpy.core.ma import *
+ #print "using ma"
Deleted: trunk/matplotlib/lib/matplotlib/numerix/npyma.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/npyma.py	2007年07月20日 08:49:00 UTC (rev 3583)
+++ trunk/matplotlib/lib/matplotlib/numerix/npyma.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,10 +0,0 @@
-from matplotlib.numerix import use_maskedarray
-
-from numpy.core.ma import *
-
-if use_maskedarray:
- from maskedarray import *
- print "using maskedarray"
-else:
- from numpy.core.ma import *
- #print "using ma"
Copied: trunk/matplotlib/lib/matplotlib/numerix/random_array (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/random_array)
Deleted: trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1,13 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.random_array import *
-elif which[0] == "numeric":
- from RandomArray import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.random_array import *
- except ImportError:
- from numpy.random import *
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py)
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -0,0 +1,13 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.random_array import *
+elif which[0] == "numeric":
+ from RandomArray import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.random_array import *
+ except ImportError:
+ from numpy.random import *
+else:
+ raise RuntimeError("invalid numerix selector")
Deleted: trunk/matplotlib/lib/matplotlib/numerix/random_array.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/random_array.py	2007年07月20日 08:49:00 UTC (rev 3583)
+++ trunk/matplotlib/lib/matplotlib/numerix/random_array.py	2007年07月20日 08:56:16 UTC (rev 3584)
@@ -1 +0,0 @@
-from numpy.oldnumeric.random_array import *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2007年07月20日 08:49:03
Revision: 3583
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3583&view=rev
Author: efiring
Date: 2007年07月20日 01:49:00 -0700 (2007年7月20日)
Log Message:
-----------
Reversed last commit
Removed Paths:
-------------
 trunk/matplotlib/_na_imports.py
 trunk/matplotlib/_nc_imports.py
 trunk/matplotlib/_sp_imports.py
 trunk/matplotlib/fft/
 trunk/matplotlib/linear_algebra/
 trunk/matplotlib/ma/
 trunk/matplotlib/mlab/
 trunk/matplotlib/npyma/
 trunk/matplotlib/random_array/
Deleted: trunk/matplotlib/_na_imports.py
===================================================================
--- trunk/matplotlib/_na_imports.py	2007年07月20日 08:23:01 UTC (rev 3582)
+++ trunk/matplotlib/_na_imports.py	2007年07月20日 08:49:00 UTC (rev 3583)
@@ -1,76 +0,0 @@
-"""Imports from numarray for numerix, the numarray/Numeric interchangeability
-module. These array functions are used when numarray is chosen.
-"""
-from numarray import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
- Float32, Float64, Complex32, Complex64, Float, Int, Complex,\
- typecode
-import numarray.ieeespecial as _ieee
-inf = infinity = infty = Infinity = _ieee.inf
-isnan = _ieee.isnan
-
-class _TypeNamespace:
- """Numeric compatible type aliases for use with extension functions."""
- Int8 = typecode[Int8]
- UInt8 = typecode[UInt8]
- Int16 = typecode[Int16]
- UInt16 = typecode[UInt16]
- Int32 = typecode[Int32]
- #UInt32 = typecode[UInt32] # Todd: this appears broken
- Float32 = typecode[Float32]
- Float64 = typecode[Float64]
- Complex32 = typecode[Complex32]
- Complex64 = typecode[Complex64]
-
-nx = _TypeNamespace()
-
-from numarray import asarray, dot, fromlist, NumArray, shape, alltrue
-from numarray import all as _all
-
-def all(a, axis=None):
- '''Numpy-compatible version of all()'''
- if axis is None:
- return _all(a)
- return alltrue(a, axis)
-
-class _Matrix(NumArray):
- """_Matrix is a ported, stripped down version of the Numeric Matrix
- class which supplies only matrix multiplication.
- """
- def _rc(self, a):
- if len(shape(a)) == 0:
- return a
- else:
- return Matrix(a)
-
- def __mul__(self, other):
- aother = asarray(other)
- #if len(aother.shape) == 0:
- # return self._rc(self*aother)
- #else:
- # return self._rc(dot(self, aother))
- #return self._rc(dot(self, aother))
- return dot(self, aother)
-
- def __rmul__(self, other):
- aother = asarray(other)
- if len(aother.shape) == 0:
- return self._rc(aother*self)
- else:
- return self._rc(dot(aother, self))
-
- def __imul__(self,other):
- aother = asarray(other)
- self[:] = dot(self, aother)
- return self
-
-def Matrix(data, typecode=None, copy=1, savespace=0):
- """Matrix constructs new matrices from 2D nested lists of numbers"""
- if isinstance(data, type("")):
- raise TypeError("numerix Matrix does not support Numeric matrix string notation. Use nested lists.")
- a = fromlist(data, type=typecode)
- if a.rank == 0:
- a.shape = (1,1)
- elif a.rank == 1:
- a.shape = (1,) + a.shape
- a.__class__ = _Matrix
- return a
Deleted: trunk/matplotlib/_nc_imports.py
===================================================================
--- trunk/matplotlib/_nc_imports.py	2007年07月20日 08:23:01 UTC (rev 3582)
+++ trunk/matplotlib/_nc_imports.py	2007年07月20日 08:49:00 UTC (rev 3583)
@@ -1,42 +0,0 @@
-from Numeric import array, ravel, reshape, shape, alltrue, sometrue
-from Numeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
- Float32, Float64, Complex32, Complex64, Float, Int, Complex
-from numpy import isnan as _isnan
-
-class _TypeNamespace:
- """Numeric compatible type aliases for use with extension functions."""
- Int8 = Int8
- UInt8 = UInt8
- Int16 = Int16
- UInt16 = UInt16
- Int32 = Int32
- UInt32 = UInt32
- Float32 = Float32
- Float64 = Float64
- Complex32 = Complex32
- Complex64 = Complex64
-
-nx = _TypeNamespace()
-
-def isnan(a):
- """y = isnan(x) returns True where x is Not-A-Number"""
- return reshape(array([_isnan(i) for i in ravel(a)],'b'), shape(a))
-
-def all(a, axis=None):
- '''Numpy-compatible version of all()'''
- if axis is None:
- return alltrue(ravel(a))
- else:
- return alltrue(a, axis)
-
-def any(a, axis=None):
- if axis is None:
- return sometrue(ravel(a))
- else:
- return sometrue(a, axis)
-
-
-# inf is useful for testing infinities in results of array divisions
-# (which don't raise exceptions)
-
-inf = infty = infinity = Infinity = (array([1])/0.0)[0]
Deleted: trunk/matplotlib/_sp_imports.py
===================================================================
--- trunk/matplotlib/_sp_imports.py	2007年07月20日 08:23:01 UTC (rev 3582)
+++ trunk/matplotlib/_sp_imports.py	2007年07月20日 08:49:00 UTC (rev 3583)
@@ -1,34 +0,0 @@
-try:
- from numpy.oldnumeric import Int8, UInt8, \
- Int16, UInt16, \
- Int32, UInt32, \
- Float32, Float64, \
- Complex32, Complex64, \
- Float, Int, Complex
-except ImportError:
- from numpy import Int8, UInt8, \
- Int16, UInt16, \
- Int32, UInt32, \
- Float32, Float64, \
- Complex32, Complex64, \
- Float, Int, Complex
-
-class _TypeNamespace:
- """Numeric compatible type aliases for use with extension functions."""
- Int8 = Int8
- UInt8 = UInt8
- Int16 = Int16
- UInt16 = UInt16
- Int32 = Int32
- UInt32 = UInt32
- Float32 = Float32
- Float64 = Float64
- Complex32 = Complex32
- Complex64 = Complex64
-
-nx = _TypeNamespace()
-
-from numpy import inf, infty, Infinity
-from numpy.random import rand, randn
-infinity = Infinity
-from numpy import all, isnan, any
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2007年07月20日 08:23:07
Revision: 3582
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3582&view=rev
Author: efiring
Date: 2007年07月20日 01:23:01 -0700 (2007年7月20日)
Log Message:
-----------
More numerix reversion.
Added Paths:
-----------
 trunk/matplotlib/_na_imports.py
 trunk/matplotlib/_nc_imports.py
 trunk/matplotlib/_sp_imports.py
 trunk/matplotlib/fft/
 trunk/matplotlib/fft/__init__.py
 trunk/matplotlib/linear_algebra/
 trunk/matplotlib/linear_algebra/__init__.py
 trunk/matplotlib/ma/
 trunk/matplotlib/ma/__init__.py
 trunk/matplotlib/mlab/
 trunk/matplotlib/mlab/.cvsignore
 trunk/matplotlib/mlab/__init__.py
 trunk/matplotlib/npyma/
 trunk/matplotlib/npyma/__init__.py
 trunk/matplotlib/random_array/
 trunk/matplotlib/random_array/__init__.py
Removed Paths:
-------------
 trunk/matplotlib/fft/__init__.py
 trunk/matplotlib/linear_algebra/__init__.py
 trunk/matplotlib/ma/__init__.py
 trunk/matplotlib/mlab/.cvsignore
 trunk/matplotlib/mlab/__init__.py
 trunk/matplotlib/npyma/__init__.py
 trunk/matplotlib/random_array/__init__.py
Copied: trunk/matplotlib/_na_imports.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py)
===================================================================
--- trunk/matplotlib/_na_imports.py	 (rev 0)
+++ trunk/matplotlib/_na_imports.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,76 @@
+"""Imports from numarray for numerix, the numarray/Numeric interchangeability
+module. These array functions are used when numarray is chosen.
+"""
+from numarray import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
+ Float32, Float64, Complex32, Complex64, Float, Int, Complex,\
+ typecode
+import numarray.ieeespecial as _ieee
+inf = infinity = infty = Infinity = _ieee.inf
+isnan = _ieee.isnan
+
+class _TypeNamespace:
+ """Numeric compatible type aliases for use with extension functions."""
+ Int8 = typecode[Int8]
+ UInt8 = typecode[UInt8]
+ Int16 = typecode[Int16]
+ UInt16 = typecode[UInt16]
+ Int32 = typecode[Int32]
+ #UInt32 = typecode[UInt32] # Todd: this appears broken
+ Float32 = typecode[Float32]
+ Float64 = typecode[Float64]
+ Complex32 = typecode[Complex32]
+ Complex64 = typecode[Complex64]
+
+nx = _TypeNamespace()
+
+from numarray import asarray, dot, fromlist, NumArray, shape, alltrue
+from numarray import all as _all
+
+def all(a, axis=None):
+ '''Numpy-compatible version of all()'''
+ if axis is None:
+ return _all(a)
+ return alltrue(a, axis)
+
+class _Matrix(NumArray):
+ """_Matrix is a ported, stripped down version of the Numeric Matrix
+ class which supplies only matrix multiplication.
+ """
+ def _rc(self, a):
+ if len(shape(a)) == 0:
+ return a
+ else:
+ return Matrix(a)
+
+ def __mul__(self, other):
+ aother = asarray(other)
+ #if len(aother.shape) == 0:
+ # return self._rc(self*aother)
+ #else:
+ # return self._rc(dot(self, aother))
+ #return self._rc(dot(self, aother))
+ return dot(self, aother)
+
+ def __rmul__(self, other):
+ aother = asarray(other)
+ if len(aother.shape) == 0:
+ return self._rc(aother*self)
+ else:
+ return self._rc(dot(aother, self))
+
+ def __imul__(self,other):
+ aother = asarray(other)
+ self[:] = dot(self, aother)
+ return self
+
+def Matrix(data, typecode=None, copy=1, savespace=0):
+ """Matrix constructs new matrices from 2D nested lists of numbers"""
+ if isinstance(data, type("")):
+ raise TypeError("numerix Matrix does not support Numeric matrix string notation. Use nested lists.")
+ a = fromlist(data, type=typecode)
+ if a.rank == 0:
+ a.shape = (1,1)
+ elif a.rank == 1:
+ a.shape = (1,) + a.shape
+ a.__class__ = _Matrix
+ return a
Copied: trunk/matplotlib/_nc_imports.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py)
===================================================================
--- trunk/matplotlib/_nc_imports.py	 (rev 0)
+++ trunk/matplotlib/_nc_imports.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,42 @@
+from Numeric import array, ravel, reshape, shape, alltrue, sometrue
+from Numeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
+ Float32, Float64, Complex32, Complex64, Float, Int, Complex
+from numpy import isnan as _isnan
+
+class _TypeNamespace:
+ """Numeric compatible type aliases for use with extension functions."""
+ Int8 = Int8
+ UInt8 = UInt8
+ Int16 = Int16
+ UInt16 = UInt16
+ Int32 = Int32
+ UInt32 = UInt32
+ Float32 = Float32
+ Float64 = Float64
+ Complex32 = Complex32
+ Complex64 = Complex64
+
+nx = _TypeNamespace()
+
+def isnan(a):
+ """y = isnan(x) returns True where x is Not-A-Number"""
+ return reshape(array([_isnan(i) for i in ravel(a)],'b'), shape(a))
+
+def all(a, axis=None):
+ '''Numpy-compatible version of all()'''
+ if axis is None:
+ return alltrue(ravel(a))
+ else:
+ return alltrue(a, axis)
+
+def any(a, axis=None):
+ if axis is None:
+ return sometrue(ravel(a))
+ else:
+ return sometrue(a, axis)
+
+
+# inf is useful for testing infinities in results of array divisions
+# (which don't raise exceptions)
+
+inf = infty = infinity = Infinity = (array([1])/0.0)[0]
Copied: trunk/matplotlib/_sp_imports.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py)
===================================================================
--- trunk/matplotlib/_sp_imports.py	 (rev 0)
+++ trunk/matplotlib/_sp_imports.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,34 @@
+try:
+ from numpy.oldnumeric import Int8, UInt8, \
+ Int16, UInt16, \
+ Int32, UInt32, \
+ Float32, Float64, \
+ Complex32, Complex64, \
+ Float, Int, Complex
+except ImportError:
+ from numpy import Int8, UInt8, \
+ Int16, UInt16, \
+ Int32, UInt32, \
+ Float32, Float64, \
+ Complex32, Complex64, \
+ Float, Int, Complex
+
+class _TypeNamespace:
+ """Numeric compatible type aliases for use with extension functions."""
+ Int8 = Int8
+ UInt8 = UInt8
+ Int16 = Int16
+ UInt16 = UInt16
+ Int32 = Int32
+ UInt32 = UInt32
+ Float32 = Float32
+ Float64 = Float64
+ Complex32 = Complex32
+ Complex64 = Complex64
+
+nx = _TypeNamespace()
+
+from numpy import inf, infty, Infinity
+from numpy.random import rand, randn
+infinity = Infinity
+from numpy import all, isnan, any
Copied: trunk/matplotlib/fft (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/fft)
Deleted: trunk/matplotlib/fft/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/fft/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -1,13 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.fft import *
-elif which[0] == "numeric":
- from FFT import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.fft import *
- except ImportError:
- from numpy.dft.old import *
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/fft/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/fft/__init__.py)
===================================================================
--- trunk/matplotlib/fft/__init__.py	 (rev 0)
+++ trunk/matplotlib/fft/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,13 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.fft import *
+elif which[0] == "numeric":
+ from FFT import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.fft import *
+ except ImportError:
+ from numpy.dft.old import *
+else:
+ raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/linear_algebra (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/linear_algebra)
Deleted: trunk/matplotlib/linear_algebra/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/linear_algebra/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -1,13 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.linear_algebra import *
-elif which[0] == "numeric":
- from LinearAlgebra import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.linear_algebra import *
- except ImportError:
- from numpy.linalg.old import *
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/linear_algebra/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/__init__.py)
===================================================================
--- trunk/matplotlib/linear_algebra/__init__.py	 (rev 0)
+++ trunk/matplotlib/linear_algebra/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,13 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.linear_algebra import *
+elif which[0] == "numeric":
+ from LinearAlgebra import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.linear_algebra import *
+ except ImportError:
+ from numpy.linalg.old import *
+else:
+ raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/ma (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/ma)
Deleted: trunk/matplotlib/ma/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/ma/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -1,24 +0,0 @@
-from matplotlib.numerix import which, use_maskedarray
-
-if which[0] == "numarray":
- from numarray.ma import *
- nomask = None
- getmaskorNone = getmask
-elif which[0] == "numeric":
- from MA import *
- nomask = None
- getmaskorNone = getmask
-elif which[0] == "numpy":
- if use_maskedarray:
- from maskedarray import *
- print "using maskedarray"
- else:
- from numpy.core.ma import *
- #print "using ma"
- def getmaskorNone(obj):
- _msk = getmask(obj)
- if _msk is nomask:
- return None
- return _msk
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/ma/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/ma/__init__.py)
===================================================================
--- trunk/matplotlib/ma/__init__.py	 (rev 0)
+++ trunk/matplotlib/ma/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,24 @@
+from matplotlib.numerix import which, use_maskedarray
+
+if which[0] == "numarray":
+ from numarray.ma import *
+ nomask = None
+ getmaskorNone = getmask
+elif which[0] == "numeric":
+ from MA import *
+ nomask = None
+ getmaskorNone = getmask
+elif which[0] == "numpy":
+ if use_maskedarray:
+ from maskedarray import *
+ print "using maskedarray"
+ else:
+ from numpy.core.ma import *
+ #print "using ma"
+ def getmaskorNone(obj):
+ _msk = getmask(obj)
+ if _msk is nomask:
+ return None
+ return _msk
+else:
+ raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/mlab (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/mlab)
Property changes on: trunk/matplotlib/mlab
___________________________________________________________________
Name: svn:ignore
 + *.pyc
Deleted: trunk/matplotlib/mlab/.cvsignore
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/mlab/.cvsignore	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -1 +0,0 @@
-*.pyc
Copied: trunk/matplotlib/mlab/.cvsignore (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/mlab/.cvsignore)
===================================================================
--- trunk/matplotlib/mlab/.cvsignore	 (rev 0)
+++ trunk/matplotlib/mlab/.cvsignore	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1 @@
+*.pyc
Deleted: trunk/matplotlib/mlab/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/mlab/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -1,16 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.linear_algebra.mlab import *
-elif which[0] == "numeric":
- from MLab import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.mlab import *
- except ImportError:
- from numpy.lib.mlab import *
-else:
- raise RuntimeError("invalid numerix selector")
-
-amin = min
-amax = max
Copied: trunk/matplotlib/mlab/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/mlab/__init__.py)
===================================================================
--- trunk/matplotlib/mlab/__init__.py	 (rev 0)
+++ trunk/matplotlib/mlab/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,16 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.linear_algebra.mlab import *
+elif which[0] == "numeric":
+ from MLab import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.mlab import *
+ except ImportError:
+ from numpy.lib.mlab import *
+else:
+ raise RuntimeError("invalid numerix selector")
+
+amin = min
+amax = max
Copied: trunk/matplotlib/npyma (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/npyma)
Deleted: trunk/matplotlib/npyma/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/npyma/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -1,8 +0,0 @@
-from matplotlib.numerix import use_maskedarray
-
-if use_maskedarray:
- from maskedarray import *
- print "using maskedarray"
-else:
- from numpy.core.ma import *
- #print "using ma"
Copied: trunk/matplotlib/npyma/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/npyma/__init__.py)
===================================================================
--- trunk/matplotlib/npyma/__init__.py	 (rev 0)
+++ trunk/matplotlib/npyma/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,8 @@
+from matplotlib.numerix import use_maskedarray
+
+if use_maskedarray:
+ from maskedarray import *
+ print "using maskedarray"
+else:
+ from numpy.core.ma import *
+ #print "using ma"
Copied: trunk/matplotlib/random_array (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/random_array)
Deleted: trunk/matplotlib/random_array/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/random_array/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -1,13 +0,0 @@
-from matplotlib.numerix import which
-
-if which[0] == "numarray":
- from numarray.random_array import *
-elif which[0] == "numeric":
- from RandomArray import *
-elif which[0] == "numpy":
- try:
- from numpy.oldnumeric.random_array import *
- except ImportError:
- from numpy.random import *
-else:
- raise RuntimeError("invalid numerix selector")
Copied: trunk/matplotlib/random_array/__init__.py (from rev 3573, trunk/matplotlib/lib/matplotlib/numerix/random_array/__init__.py)
===================================================================
--- trunk/matplotlib/random_array/__init__.py	 (rev 0)
+++ trunk/matplotlib/random_array/__init__.py	2007年07月20日 08:23:01 UTC (rev 3582)
@@ -0,0 +1,13 @@
+from matplotlib.numerix import which
+
+if which[0] == "numarray":
+ from numarray.random_array import *
+elif which[0] == "numeric":
+ from RandomArray import *
+elif which[0] == "numpy":
+ try:
+ from numpy.oldnumeric.random_array import *
+ except ImportError:
+ from numpy.random import *
+else:
+ raise RuntimeError("invalid numerix selector")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3581
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3581&view=rev
Author: jdh2358
Date: 2007年07月19日 20:36:59 -0700 (2007年7月19日)
Log Message:
-----------
added mpl like line and rect artists to sketch
Modified Paths:
--------------
 trunk/matplotlib/mpl1/mpl1.py
Modified: trunk/matplotlib/mpl1/mpl1.py
===================================================================
--- trunk/matplotlib/mpl1/mpl1.py	2007年07月20日 02:10:43 UTC (rev 3580)
+++ trunk/matplotlib/mpl1/mpl1.py	2007年07月20日 03:36:59 UTC (rev 3581)
@@ -252,7 +252,7 @@
 raise NotImplementedError
 
 
-mtraits.Model = traits.Trait(Identity(), Polar())
+mtraits.Model = traits.Trait(None, Identity, Polar)
 
 
 
@@ -265,12 +265,12 @@
 MOVETO, LINETO, CLOSEPOLY = range(3)
 
 strokecolor = mtraits.Color('black')
- fillcolor = mtraits.Color('blue')
- alpha = mtraits.Alpha(1.0)
- linewidth = mtraits.LineWidth(1.0)
+ fillcolor = mtraits.Color('blue')
+ alpha = mtraits.Alpha(1.0)
+ linewidth = mtraits.LineWidth(1.0)
 antialiased = mtraits.FlexibleTrueTrait()
- pathdata = mtraits.PathData()
- affine = mtraits.Affine()
+ pathdata = mtraits.PathData()
+ affine = mtraits.Affine()
 
 def __init__(self):
 
@@ -279,11 +279,10 @@
 # instances, which is not what I want
 self.strokecolor = 'black'
 self.fillcolor = 'blue'
- self.pathdata = (npy.array([0,0], npy.uint8), # codes
- npy.array([[0,0], [0,0]])) # verts
 self.affine = affine_identity()
- 
- 
+ self.pathdata = (npy.array([0,0], npy.uint8), # codes
+ npy.array([[0,0], [0,0]])) # verts
+ 
 mtraits.Path = traits.Trait(Path())
 
 class AggPath(Path):
@@ -350,10 +349,10 @@
 return agg.rgba8(*rgba)
 
 class Markers(traits.HasTraits):
- verts = mtraits.Verts() # locations to draw the markers at
- path = mtraits.Path() # marker path in points
+ verts = mtraits.Verts() # locations to draw the markers at
+ path = mtraits.Path() # marker path in points
 affine = mtraits.Affine() # transformation for the verts
- x = traits.Float(1.0)
+ x = traits.Float(1.0)
 
 def __init__(self):
 # this is a quick workaround to prevent sharing obs; see Path
@@ -405,10 +404,10 @@
 artistID = IDGenerator()
 
 class Artist(traits.HasTraits):
- zorder = traits.Float(1.0)
- alpha = mtraits.Alpha(1.0)
+ zorder = traits.Float(1.0)
+ alpha = mtraits.Alpha(1.0)
 visible = mtraits.FlexibleTrueTrait()
- affine = mtraits.Affine()
+ affine = mtraits.Affine()
 
 def __init__(self):
 self.artistid = artistID()
@@ -439,8 +438,8 @@
 path = mtraits.Path()
 markers = mtraits.Markers()
 X = mtraits.Verts()
- model = mtraits.Model(Identity())
-
+ model = mtraits.Model
+ zorder = traits.Float(2.0)
 
 def __init__(self):
 """
@@ -449,6 +448,19 @@
 """
 Artist.__init__(self)
 
+ # this is potentially a big problem because you have to know
+ # which attrs may be shared and hence have to be initialized
+ # and which ones don't. Eg, if you comment out the self.path
+ # init, the code breaks
+ self.color = 'blue'
+ self.markerfacecolor = 'blue'
+ self.markeredgecolor = 'black'
+ self.path = Path()
+ self.markers = Markers()
+ self.X = npy.array([[0,1], [0,1]], npy.float_)
+ self.model = Identity()
+ #self.model = None # switch comments with above to reveal bug 
+ 
 self.sync_trait('linewidth', self.path, 'linewidth', mutual=False)
 self.sync_trait('color', self.path, 'strokecolor', mutual=False)
 self.sync_trait('markerfacecolor', self.markers.path, 'fillcolor', mutual=False)
@@ -494,11 +506,15 @@
 codes = Path.LINETO*npy.ones(N, dtype=npy.uint8)
 codes[0] = Path.MOVETO
 
- modelx = self.model(newx)
+ # todo, having touble setting Model to default to Identity so
+ # allowing None as a hack workaround
+ if self.model is not None:
+ modelx = self.model(newx)
+ else:
+ modelx = newx
 self.path.pathdata = codes, modelx
 self.markers.verts = modelx
 
-
 def _markersize_changed(self, oldX, newX):
 self._refresh_markers()
 
@@ -526,25 +542,27 @@
 facecolor = mtraits.Color('Yellow')
 edgecolor = mtraits.Color('Black')
 edgewidth = mtraits.LineWidth(1.0)
- lbwh = traits.Array('d', (4,), [0,0,1,1])
- path = mtraits.Path()
- 
+ lbwh = traits.Array('d', (4,), [0,0,1,1])
+ path = mtraits.Path()
+ zorder = traits.Float(1.0)
+
 def __init__(self):
+ Artist.__init__(self)
 self.facecolor = 'yellow'
 self.edgecolor = 'black'
 self.edgewidth = 1.0
 self.lbwh = 0,0,1,1
 self.path = Path()
 
- self.sync_trait('facecolor', self, 'fillcolor', True)
- self.sync_trait('edgecolor', self, 'strokecolor', True)
- self.sync_trait('edgewidth', self, 'linewidth', True)
- self.sync_trait('affine', self.markers)
+ self.sync_trait('facecolor', self.path, 'fillcolor', mutual=False)
+ self.sync_trait('edgecolor', self.path, 'strokecolor', mutual=False)
+ self.sync_trait('edgewidth', self.path, 'linewidth', mutual=False)
+ self.sync_trait('affine', self.path, mutual=False)
 
 self.pathid = primitiveID()
- 
+
+
 def _lbwh_changed(self, old, new):
- print 'lbwh changed'
 l,b,w,h = new
 t = b+h
 r = l+w
@@ -567,7 +585,6 @@
 raise RuntimeError('First call set_renderer')
 
 if not self.visible: return
-
 self.renderer.render_path(self.pathid)
 
 class Figure:
@@ -593,11 +610,11 @@
 
 
 class AxesCoords(traits.HasTraits):
- xviewlim = mtraits.Interval()
- yviewlim = mtraits.Interval()
+ xviewlim = mtraits.Interval()
+ yviewlim = mtraits.Interval()
 affineview = mtraits.Affine()
 affineaxes = mtraits.Affine() 
- affine = mtraits.Affine() 
+ affine = mtraits.Affine() 
 
 def __init__(self):
 self.xviewlim = npy.array([0., 1.])
@@ -630,7 +647,7 @@
 self.affine = npy.dot(self.affineaxes, self.affineview)
 
 
-x1 = npy.arange(0, 10., 0.1)
+x1 = npy.arange(0, 10., 0.05)
 x2 = npy.arange(0, 10., 0.1)
 y1 = npy.cos(2*npy.pi*x1)
 y2 = 10*npy.exp(-x1)
@@ -646,26 +663,26 @@
 line1.X = npy.array([x1,y1]).T
 
 line1.setp(color='blue', linewidth=2.0, marker='s', markersize=5.0,
- markerfacecolor='green', markeredgewidth=0.5)
+ markerfacecolor='green', markeredgewidth=0.5)
 coords1.sync_trait('affine', line1, mutual=False)
 
 fig.artistd[line1.artistid] = line1
 
+
 rect1 = Rectangle()
 rect1.lbwh = [0,0,1,1]
 rect1.facecolor = 'white'
 fig.artistd[rect1.artistid] = rect1
+coords1.sync_trait('affineaxes', rect1, 'affine', mutual=False)
 
 
-#coords1.sync_trait('affineaxes', rect1, 'affine')
-
 # update the view limits, all the affines should be automagically updated
 coords1.xviewlim = 0, 10
 coords1.yviewlim = -1.1, 1.1
 
 
-if 0:
- # the axes rectangle
+
+if 1:
 axrect2 = [0.55, 0.55, 0.4, 0.4]
 coords2 = AxesCoords()
 coords2.affineaxes = affine_axes(axrect2)
@@ -673,16 +690,22 @@
 
 r = npy.arange(0.0, 1.0, 0.01)
 theta = r*4*npy.pi
+ 
+ line2 = Line()
+ line2.model = Polar()
+ line2.setp(color='#ee8d18', linewidth=2.0)
+ line2.X = npy.array([r, theta]).T
+ coords2.sync_trait('affine', line2, mutual=False)
 
- line2 = Line(r, theta, model=Polar(), color='#ee8d18', linewidth=2.0)
- rect2 = Rectangle([0,0,1,1], facecolor='#d5de9c')
- coords2.sync_trait('affine', line2, mutual=False)
+ rect2 = Rectangle()
+ rect2.lbwh = [0,0,1,1]
+ rect2.facecolor = '#d5de9c'
 coords2.sync_trait('affineaxes', rect2, 'affine', mutual=False)
 
- fig.add_path(rect2)
- fig.add_path(line2)
+ fig.artistd[line2.artistid] = line2
+ fig.artistd[rect2.artistid] = rect2 
 
- # update the view limits, all the affines should be automagically updated
+
 coords2.xviewlim = -1.1, 1.1
 coords2.yviewlim = -1.1, 1.1
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2007年07月20日 02:10:44
Revision: 3580
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3580&view=rev
Author: jdh2358
Date: 2007年07月19日 19:10:43 -0700 (2007年7月19日)
Log Message:
-----------
reverted numerix breakage, with apologies
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/art3d.py
 trunk/matplotlib/lib/matplotlib/axes3d.py
 trunk/matplotlib/lib/matplotlib/axis.py
 trunk/matplotlib/lib/matplotlib/axis3d.py
 trunk/matplotlib/lib/matplotlib/backend_bases.py
 trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
 trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py
 trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
 trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
 trunk/matplotlib/lib/matplotlib/backends/backend_gd.py
 trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
 trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
 trunk/matplotlib/lib/matplotlib/backends/backend_paint.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_tkagg.py
 trunk/matplotlib/lib/matplotlib/collections.py
 trunk/matplotlib/lib/matplotlib/colors.py
 trunk/matplotlib/lib/matplotlib/figure.py
 trunk/matplotlib/lib/matplotlib/finance.py
 trunk/matplotlib/lib/matplotlib/image.py
 trunk/matplotlib/lib/matplotlib/legend.py
 trunk/matplotlib/lib/matplotlib/lines.py
 trunk/matplotlib/lib/matplotlib/mathtext.py
 trunk/matplotlib/lib/matplotlib/mlab.py
 trunk/matplotlib/lib/matplotlib/numerix/__init__.py
 trunk/matplotlib/lib/matplotlib/patches.py
 trunk/matplotlib/lib/matplotlib/proj3d.py
 trunk/matplotlib/lib/matplotlib/table.py
 trunk/matplotlib/lib/matplotlib/texmanager.py
 trunk/matplotlib/lib/matplotlib/text.py
 trunk/matplotlib/lib/matplotlib/units.py
 trunk/matplotlib/lib/matplotlib/widgets.py
 trunk/matplotlib/mpl1/mpl1.py
 trunk/matplotlib/mpl1/mtraits.py
 trunk/matplotlib/setup.py
Modified: trunk/matplotlib/lib/matplotlib/art3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/art3d.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/art3d.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -12,7 +12,7 @@
 from colors import Normalize
 from cm import jet
 
-import numpy as npy
+import numerix as nx
 import proj3d
 
 class Wrap2D:
@@ -254,8 +254,8 @@
 segis.append((si,ei))
 si = ei
 xs,ys,zs = zip(*points)
- ones = npy.ones(len(xs))
- self.vec = npy.array([xs,ys,zs,ones])
+ ones = nx.ones(len(xs))
+ self.vec = nx.array([xs,ys,zs,ones])
 self.segis = segis
 
 def draw3d(self, renderer):
Modified: trunk/matplotlib/lib/matplotlib/axes3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes3d.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/axes3d.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -17,7 +17,7 @@
 from transforms import unit_bbox
 
 import figure
-import numpy as npy
+import numerix as nx
 from colors import Normalize
 
 import art3d
@@ -122,8 +122,8 @@
 self.zz_dataLim.intervalx, self)
 
 def unit_cube(self,vals=None):
- minpy,maxx,miny,maxy,minz,maxz = vals or self.get_w_lims()
- xs,ys,zs = ([minpy,maxx,maxx,minpy,minpy,maxx,maxx,minpy],
+ minx,maxx,miny,maxy,minz,maxz = vals or self.get_w_lims()
+ xs,ys,zs = ([minx,maxx,maxx,minx,minx,maxx,maxx,minx],
 [miny,miny,maxy,maxy,miny,miny,maxy,maxy],
 [minz,minz,minz,minz,maxz,maxz,maxz,maxz])
 return zip(xs,ys,zs)
@@ -186,7 +186,7 @@
 pass
 
 def auto_scale_xyz(self, X,Y,Z=None,had_data=None):
- x,y,z = map(npy.asarray, (X,Y,Z))
+ x,y,z = map(nx.asarray, (X,Y,Z))
 try:
 x,y = X.flat,Y.flat
 if Z is not None:
@@ -216,10 +216,10 @@
 self.set_w_zlim(locator.autoscale())
 
 def get_w_lims(self):
- minpy,maxx = self.get_w_xlim()
+ minx,maxx = self.get_w_xlim()
 miny,maxy = self.get_w_ylim()
 minz,maxz = self.get_w_zlim()
- return minpy,maxx,miny,maxy,minz,maxz
+ return minx,maxx,miny,maxy,minz,maxz
 
 def set_w_zlim(self, *args, **kwargs):
 gl,self.get_xlim = self.get_xlim,self.get_w_zlim
@@ -257,7 +257,7 @@
 def pany(self, numsteps):
 print 'numsteps', numsteps
 
- def panpy(self, numsteps):
+ def panx(self, numsteps):
 print 'numsteps', numsteps
 
 def view_init(self, elev, azim):
@@ -276,7 +276,7 @@
 point.
 
 """
- relev,razim = npy.pi * self.elev/180, npy.pi * self.azim/180
+ relev,razim = nx.pi * self.elev/180, nx.pi * self.azim/180
 
 xmin,xmax = self.get_w_xlim()
 ymin,ymax = self.get_w_ylim()
@@ -288,29 +288,29 @@
 zmin,zmax)
 
 # look into the middle of the new coordinates
- R = npy.array([0.5,0.5,0.5])
+ R = nx.array([0.5,0.5,0.5])
 #
- xp = R[0] + npy.cos(razim)*npy.cos(relev)*self.dist
- yp = R[1] + npy.sin(razim)*npy.cos(relev)*self.dist
- zp = R[2] + npy.sin(relev)*self.dist
+ xp = R[0] + nx.cos(razim)*nx.cos(relev)*self.dist
+ yp = R[1] + nx.sin(razim)*nx.cos(relev)*self.dist
+ zp = R[2] + nx.sin(relev)*self.dist
 
- E = npy.array((xp, yp, zp))
+ E = nx.array((xp, yp, zp))
 #
 self.eye = E
 self.vvec = R - E
 self.vvec = self.vvec / proj3d.mod(self.vvec)
 
- if abs(relev) > npy.pi/2:
+ if abs(relev) > nx.pi/2:
 # upside down
- V = npy.array((0,0,-1))
+ V = nx.array((0,0,-1))
 else:
- V = npy.array((0,0,1))
+ V = nx.array((0,0,1))
 zfront,zback = -self.dist,self.dist
 
 viewM = proj3d.view_transformation(E,R,V)
 perspM = proj3d.persp_transformation(zfront,zback)
- M0 = npy.dot(viewM,worldM)
- M = npy.dot(perspM,M0)
+ M0 = nx.matrixmultiply(viewM,worldM)
+ M = nx.matrixmultiply(perspM,M0)
 return M
 
 def mouse_init(self):
@@ -383,8 +383,8 @@
 # scale the z value to match
 x0,y0,z0 = p0
 x1,y1,z1 = p1
- d0 = npy.hypot(x0-xd,y0-yd)
- d1 = npy.hypot(x1-xd,y1-yd)
+ d0 = nx.hypot(x0-xd,y0-yd)
+ d1 = nx.hypot(x1-xd,y1-yd)
 dt = d0+d1
 z = d1/dt * z0 + d0/dt * z1
 #print 'mid', edgei, d0, d1, z0, z1, z
@@ -435,12 +435,12 @@
 elif self.button_pressed == 3:
 # zoom view
 # hmmm..this needs some help from clipping....
- minpy,maxx,miny,maxy,minz,maxz = self.get_w_lims()
+ minx,maxx,miny,maxy,minz,maxz = self.get_w_lims()
 df = 1-((h - dy)/h)
- dx = (maxx-minpy)*df
+ dx = (maxx-minx)*df
 dy = (maxy-miny)*df
 dz = (maxz-minz)*df
- self.set_w_xlim(minpy-dx,maxx+dx)
+ self.set_w_xlim(minx-dx,maxx+dx)
 self.set_w_ylim(miny-dy,maxy+dy)
 self.set_w_zlim(minz-dz,maxz+dz)
 self.get_proj()
@@ -504,14 +504,14 @@
 had_data = self.has_data()
 
 rows, cols = Z.shape
- tX,tY,tZ = npy.transpose(X), npy.transpose(Y), npy.transpose(Z)
+ tX,tY,tZ = nx.transpose(X), nx.transpose(Y), nx.transpose(Z)
 rstride = cbook.popd(kwargs, 'rstride', 10)
 cstride = cbook.popd(kwargs, 'cstride', 10)
 #
 polys = []
 boxes = []
- for rs in npy.arange(0,rows,rstride):
- for cs in npy.arange(0,cols,cstride):
+ for rs in nx.arange(0,rows,rstride):
+ for cs in nx.arange(0,cols,cstride):
 ps = []
 corners = []
 for a,ta in [(X,tX),(Y,tY),(Z,tZ)]:
@@ -522,9 +522,9 @@
 zright = ta[cs][rs:min(rows-1,rs+rstride):]
 zright = zright[::-1]
 corners.append([ztop[0],ztop[-1],zbase[0],zbase[-1]])
- z = npy.concatenate((ztop,zleft,zbase,zright))
+ z = nx.concatenate((ztop,zleft,zbase,zright))
 ps.append(z)
- boxes.append(map(npy.array,zip(*corners)))
+ boxes.append(map(nx.array,zip(*corners)))
 polys.append(zip(*ps))
 #
 lines = []
@@ -533,10 +533,10 @@
 n = proj3d.cross(box[0]-box[1],
 box[0]-box[2])
 n = n/proj3d.mod(n)*5
- shade.append(npy.dot(n,[-1,-1,0.5]))
+ shade.append(nx.dot(n,[-1,-1,0.5]))
 lines.append((box[0],n+box[0]))
 #
- color = npy.array([0,0,1,1])
+ color = nx.array([0,0,1,1])
 norm = Normalize(min(shade),max(shade))
 colors = [color * (0.5+norm(v)*0.5) for v in shade]
 for c in colors: c[3] = 1
@@ -554,7 +554,7 @@
 had_data = self.has_data()
 rows,cols = Z.shape
 
- tX,tY,tZ = npy.transpose(X), npy.transpose(Y), npy.transpose(Z)
+ tX,tY,tZ = nx.transpose(X), nx.transpose(Y), nx.transpose(Z)
 
 rii = [i for i in range(0,rows,rstride)]+[rows-1]
 cii = [i for i in range(0,cols,cstride)]+[cols-1]
@@ -718,7 +718,7 @@
 
 def get_test_data(delta=0.05):
 from mlab import meshgrid, bivariate_normal
- x = y = npy.arange(-3.0, 3.0, delta)
+ x = y = nx.arange(-3.0, 3.0, delta)
 X, Y = meshgrid(x,y)
 
 Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
@@ -764,8 +764,8 @@
 
 def test_plot():
 ax = Axes3D()
- xs = npy.arange(0,4*npy.pi+0.1,0.1)
- ys = npy.sin(xs)
+ xs = nx.arange(0,4*nx.pi+0.1,0.1)
+ ys = nx.sin(xs)
 ax.plot(xs,ys, label='zl')
 ax.plot(xs,ys+max(xs),label='zh')
 ax.plot(xs,ys,dir='x', label='xl')
@@ -785,7 +785,7 @@
 cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.6)
 
 ax = Axes3D()
- xs = npy.arange(0,10,0.4)
+ xs = nx.arange(0,10,0.4)
 verts = []
 zs = [0.0,1.0,2.0,3.0]
 for z in zs:
@@ -817,7 +817,7 @@
 ax = Axes3D()
 
 for c,z in zip(['r','g','b','y'],[30,20,10,0]):
- xs = npy.arange(20)
+ xs = nx.arange(20)
 ys = [random.random() for x in xs]
 ax.bar(xs,ys,z=z,dir='y',color=c)
 #ax.plot(xs,ys)
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/axis.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -7,13 +7,14 @@
 import re
 import sys
 
-from numpy import arange, array, asarray, ones, zeros, \
- nonzero, take, log10, logical_and, \
- dot, sin, cos, tan, pi, sqrt, linspace
+from numerix import arange, array, asarray, ones, zeros, \
+ nonzero, take, Float, log10, logical_and, \
+ dot, sin, cos, tan, pi, sqrt
 
 from artist import Artist, setp
 from cbook import enumerate, silent_list, popall, CallbackRegistry
 from lines import Line2D, TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN
+from mlab import linspace
 from matplotlib import rcParams
 from patches import bbox_artist
 from ticker import NullFormatter, FixedFormatter, ScalarFormatter, LogFormatter
@@ -117,7 +118,7 @@
 
 def contains(self, mouseevent):
 """Test whether the mouse event occured in the Tick marks.
-
+ 
 This function always returns false. It is more useful to test if the
 axis as a whole contains the mouse rather than the set of tick marks.
 """
@@ -491,7 +492,7 @@
 LABELPAD = 5
 OFFSETTEXTPAD = 3
 
- def __str__(self):
+ def __str__(self): 
 return str(self.__class__).split('.')[-1] \
 + "(%d,%d)"%self.axes.transAxes.xy_tup((0,0))
 
@@ -656,7 +657,7 @@
 def get_offset_text(self):
 'Return the axis offsetText as a Text instance'
 return self.offsetText
-
+ 
 def get_pickradius(self):
 'Return the depth of the axis used by the picker'
 return self.pickradius
@@ -900,11 +901,11 @@
 self.minor.locator = locator
 self.minor.locator.set_view_interval( self.get_view_interval() )
 self.minor.locator.set_data_interval( self.get_data_interval() )
-
+ 
 def set_pickradius(self, pickradius):
 """
 Set the depth of the axis used by the picker
-
+ 
 ACCEPTS: a distance in points
 """
 self.pickradius = pickradius
@@ -966,12 +967,12 @@
 
 class XAxis(Axis):
 __name__ = 'xaxis'
-
+ 
 def contains(self,mouseevent):
 """Test whether the mouse event occured in the x axis.
 """
 if callable(self._contains): return self._contains(self,mouseevent)
-
+ 
 xpixel,ypixel = mouseevent.x,mouseevent.y
 try:
 xaxes,yaxes = self.axes.transAxes.inverse_xy_tup((xpixel,ypixel))
@@ -1154,11 +1155,11 @@
 
 def contains(self,mouseevent):
 """Test whether the mouse event occurred in the y axis.
-
+ 
 Returns T/F, {}
 """
 if callable(self._contains): return self._contains(self,mouseevent)
-
+ 
 xpixel,ypixel = mouseevent.x,mouseevent.y
 try:
 xaxes,yaxes = self.axes.transAxes.inverse_xy_tup((xpixel,ypixel))
Modified: trunk/matplotlib/lib/matplotlib/axis3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis3d.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/axis3d.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -13,7 +13,7 @@
 import art3d
 import proj3d
 
-from numpy import sin, cos, pi, cumsum, dot, asarray, array, \
+from numerix import sin, cos, pi, cumsum, dot, asarray, array, \
 where, nonzero, equal, sqrt
 
 def norm_angle(a):
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -437,7 +437,7 @@
 def points_to_pixels(self, points):
 """
 Convert points to display units
- points - a float or a numpy array of float
+ points - a float or a numerix array of float
 return points converted to pixels
 
 You need to override this function (unless your backend doesn't have a
@@ -891,24 +891,24 @@
 #print "leaving:",[str(a) for a in leave]
 # On leave restore the captured colour
 for a in leave:
- if hasattr(a,'get_color'):
+ if hasattr(a,'get_color'): 
 a.set_color(self._active[a])
- elif hasattr(a,'get_edgecolor'):
+ elif hasattr(a,'get_edgecolor'): 
 a.set_edgecolor(self._active[a][0])
 a.set_facecolor(self._active[a][1])
 del self._active[a]
 # On enter, capture the color and repaint the artist
- # with the highlight colour. Capturing colour has to
- # be done first in case the parent recolouring affects
+ # with the highlight colour. Capturing colour has to 
+ # be done first in case the parent recolouring affects 
 # the child.
 for a in enter:
- if hasattr(a,'get_color'):
+ if hasattr(a,'get_color'): 
 self._active[a] = a.get_color()
 elif hasattr(a,'get_edgecolor'):
 self._active[a] = (a.get_edgecolor(),a.get_facecolor())
 else: self._active[a] = None
 for a in enter:
- if hasattr(a,'get_color'):
+ if hasattr(a,'get_color'): 
 a.set_color('red')
 elif hasattr(a,'get_edgecolor'):
 a.set_edgecolor('red')
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -73,7 +73,7 @@
 import os, sys
 import matplotlib
 from matplotlib import verbose, rcParams
-from numpy import array, zeros, transpose, fliplr
+from matplotlib.numerix import array, Float, zeros, transpose
 from matplotlib._image import fromarray
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase,\
@@ -85,6 +85,7 @@
 from matplotlib.ft2font import FT2Font
 from matplotlib.mathtext import math_parse_s_ft2font
 from matplotlib.transforms import lbwh_to_bbox
+from matplotlib.numerix.mlab import fliplr
 
 from _backend_agg import RendererAgg as _RendererAgg
 
@@ -153,8 +154,8 @@
 point in x, y
 """
 if __debug__: verbose.report('RendererAgg.draw_line', 'debug-annoying')
- x = array([x1,x2], float)
- y = array([y1,y2], float)
+ x = array([x1,x2], typecode=Float)
+ y = array([y1,y2], typecode=Float)
 self._renderer.draw_lines(gc, x, y)
 
 
@@ -272,7 +273,7 @@
 def func(x):
 return transpose(fliplr(x))
 
- Z = zeros((n,m,4), float)
+ Z = zeros((n,m,4), typecode=Float)
 Z[:,:,0] = func(r)
 Z[:,:,1] = func(g)
 Z[:,:,2] = func(b)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -8,7 +8,7 @@
 import matplotlib.agg as agg
 
 from matplotlib import verbose
-from numpy import array
+from matplotlib.numerix import array, Float
 
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase,\
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -38,7 +38,7 @@
 from matplotlib.cbook import enumerate, izip
 from matplotlib.figure import Figure
 from matplotlib.mathtext import math_parse_s_ft2font
-import numpy as npy
+import matplotlib.numerix as numx
 from matplotlib.transforms import Bbox
 from matplotlib import rcParams
 
@@ -137,8 +137,8 @@
 ctx.rotate(rotation)
 ctx.scale(width / 2.0, height / 2.0)
 ctx.new_sub_path()
- ctx.arc(0.0, 0.0, 1.0, npy.pi * angle1 / 180.,
- npy.pi * angle2 / 180.)
+ ctx.arc(0.0, 0.0, 1.0, numx.pi * angle1 / 180.,
+ numx.pi * angle2 / 180.)
 ctx.restore()
 
 self._fill_and_stroke (ctx, rgbFace)
@@ -243,7 +243,7 @@
 # render by drawing a 0.5 radius circle
 ctx = gc.ctx
 ctx.new_path()
- ctx.arc (x, self.height - y, 0.5, 0, 2*npy.pi)
+ ctx.arc (x, self.height - y, 0.5, 0, 2*numx.pi)
 self._fill_and_stroke (ctx, gc.get_rgb())
 
 
@@ -294,7 +294,7 @@
 
 ctx.save()
 if angle:
- ctx.rotate (-angle * npy.pi / 180)
+ ctx.rotate (-angle * numx.pi / 180)
 ctx.set_font_size (size)
 ctx.show_text (s)
 ctx.restore()
@@ -304,7 +304,7 @@
 if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())
 # mathtext using the gtk/gdk method
 
- #if npy.which[0] == "numarray":
+ #if numx.which[0] == "numarray":
 # warnings.warn("_draw_mathtext() currently works for numpy, but "
 # "not numarray")
 # return
@@ -327,21 +327,21 @@
 N = imw*imh
 
 # a numpixels by num fonts array
- Xall = npy.zeros((N,len(fonts)), npy.uint8)
+ Xall = numx.zeros((N,len(fonts)), typecode=numx.UInt8)
 
 for i, font in enumerate(fonts):
 if angle == 90:
 font.horiz_image_to_vert_image() # <-- Rotate
 imw, imh, s = font.image_as_str()
- Xall[:,i] = npy.fromstring(s, npy.uint8)
+ Xall[:,i] = numx.fromstring(s, numx.UInt8)
 
 # get the max alpha at each pixel
- Xs = npy.mlab.max (Xall,1)
+ Xs = numx.mlab.max (Xall,1)
 
 # convert it to it's proper shape
 Xs.shape = imh, imw
 
- pa = npy.zeros((imh,imw,4), npy.uint8)
+ pa = numx.zeros(shape=(imh,imw,4), typecode=numx.UInt8)
 rgb = gc.get_rgb()
 pa[:,:,0] = int(rgb[0]*255)
 pa[:,:,1] = int(rgb[1]*255)
@@ -469,7 +469,7 @@
 self.ctx.set_dash([], 0) # switch dashes off
 else:
 self.ctx.set_dash (
- self.renderer.points_to_pixels (npy.asarray(dashes)), offset)
+ self.renderer.points_to_pixels (numx.asarray(dashes)), offset)
 
 
 def set_foreground(self, fg, isRGB=None):
@@ -593,7 +593,7 @@
 ctx = renderer.ctx
 
 if orientation == 'landscape':
- ctx.rotate (npy.pi/2)
+ ctx.rotate (numx.pi/2)
 ctx.translate (0, -height_in_points)
 # cairo/src/cairo_ps_surface.c
 # '%%Orientation: Portrait' is always written to the file header
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -17,8 +17,6 @@
 
 import os.path
 
-from numpy import asarray
-
 import matplotlib
 
 from matplotlib import rcParams, verbose
@@ -28,6 +26,7 @@
 NavigationToolbar2, cursors
 from matplotlib.figure import Figure
 from matplotlib._pylab_helpers import Gcf
+from matplotlib.numerix import asarray
 import matplotlib.windowing as windowing
 from matplotlib.widgets import SubplotTool
 
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gd.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gd.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gd.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -12,7 +12,6 @@
 sys.exit()
 
 
-from numpy import ones, array, int16, asarray
 
 from matplotlib.backend_bases import RendererBase, \
 GraphicsContextBase, FigureManagerBase, FigureCanvasBase
@@ -23,6 +22,7 @@
 from matplotlib.figure import Figure
 from matplotlib.transforms import Bbox
 from matplotlib.font_manager import fontManager
+from matplotlib.numerix import ones, array, nx, asarray
 # support old font names
 if (os.environ.has_key('GDFONTPATH') and not
 os.environ.has_key('TTFPATH')):
@@ -115,8 +115,8 @@
 point in x, y
 """
 
- x = x.astype(int16)
- y = self.height*ones(y.shape, int16) - y.astype(int16)
+ x = x.astype(nx.Int16)
+ y = self.height*ones(y.shape, nx.Int16) - y.astype(nx.Int16)
 style = self._set_gd_style(gc)
 self.im.lines( zip(x,y), style)
 self.flush_clip()
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -16,9 +16,6 @@
 % (gtk.pygtk_version + pygtk_version_required))
 del pygtk_version_required
 
-from numpy import amax, asarray, fromstring, int16, uint8, zeros, \
- where, transpose, nonzero, indices, ones
-
 import matplotlib
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
@@ -26,7 +23,11 @@
 from matplotlib.cbook import is_string_like, enumerate
 from matplotlib.figure import Figure
 from matplotlib.mathtext import math_parse_s_ft2font
+import matplotlib.numerix as numerix
+from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
+ where, transpose, nonzero, indices, ones, nx
 
+
 from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
 
 
@@ -105,7 +106,7 @@
 im.flipud_out()
 rows, cols, image_str = im.as_rgba_str()
 
- image_array = fromstring(image_str, uint8)
+ image_array = fromstring(image_str, UInt8)
 image_array.shape = rows, cols, 4
 
 pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,
@@ -143,8 +144,8 @@
 
 def draw_lines(self, gc, x, y, transform=None):
 if gc.gdkGC.line_width > 0:
- x = x.astype(int16)
- y = self.height - y.astype(int16)
+ x = x.astype(nx.Int16)
+ y = self.height - y.astype(nx.Int16)
 self.gdkDrawable.draw_lines(gc.gdkGC, zip(x,y))
 
 
@@ -212,16 +213,16 @@
 N = imw*imh
 
 # a numpixels by num fonts array
- Xall = zeros((N,len(fonts)), uint8)
+ Xall = zeros((N,len(fonts)), typecode=UInt8)
 
 for i, font in enumerate(fonts):
 if angle == 90:
 font.horiz_image_to_vert_image() # <-- Rotate
 imw, imh, image_str = font.image_as_str()
- Xall[:,i] = fromstring(image_str, uint8)
+ Xall[:,i] = fromstring(image_str, UInt8)
 
 # get the max alpha at each pixel
- Xs = amax(Xall,axis=1)
+ Xs = numerix.mlab.max(Xall,1)
 
 # convert it to it's proper shape
 Xs.shape = imh, imw
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -22,8 +22,9 @@
 from matplotlib.cbook import is_string_like, enumerate
 from matplotlib.colors import colorConverter
 from matplotlib.figure import Figure
-from numpy import asarray, fromstring, zeros, \
- where, transpose, nonzero, indices, ones
+import matplotlib.numerix as numerix
+from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
+ where, transpose, nonzero, indices, ones, nx
 from matplotlib.widgets import SubplotTool
 
 from matplotlib import lines
@@ -155,7 +156,7 @@
 gdk.LEAVE_NOTIFY_MASK |
 gdk.POINTER_MOTION_MASK |
 gdk.POINTER_MOTION_HINT_MASK)
-
+ 
 def __init__(self, figure):
 if _debug: print 'FigureCanvasGTK.%s' % fn_name()
 FigureCanvasBase.__init__(self, figure)
@@ -1086,7 +1087,7 @@
 
 hbox.show_all()
 self.set_extra_widget(hbox)
-
+ 
 def get_filename_from_user (self):
 while True:
 filename = None
@@ -1136,7 +1137,7 @@
 
 def __init__(self, lines):
 import gtk.glade
-
+ 
 datadir = matplotlib.get_data_path()
 gladefile = os.path.join(datadir, 'lineprops.glade')
 if not os.path.exists(gladefile):
@@ -1278,7 +1279,7 @@
 # Unfortunately, the SVG renderer (rsvg) leaks memory under earlier
 # versions of pygtk, so we have to use a PNG file instead.
 try:
-
+ 
 if gtk.pygtk_version < (2, 8, 0):
 icon_filename = 'matplotlib.png'
 else:
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_paint.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_paint.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_paint.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -16,10 +16,8 @@
 import sys
 import os
 import paint
-
-from numpy import asarray
-
 from matplotlib import verbose
+from matplotlib.numerix import asarray
 
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase,\
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -28,7 +28,7 @@
 from matplotlib.dviread import Dvi
 from matplotlib.ft2font import FT2Font, FIXED_WIDTH, ITALIC, LOAD_NO_SCALE
 from matplotlib.mathtext import math_parse_s_pdf
-from numpy import float32, uint8, fromstring, arange, infinity, isnan, asarray
+from matplotlib.numerix import Float32, UInt8, fromstring, arange, infinity, isnan, asarray
 from matplotlib.transforms import Bbox
 from matplotlib import ttconv
 
@@ -543,13 +543,13 @@
 fontdict['FontMatrix'] = [ .001, 0, 0, .001, 0, 0 ]
 fontdict['CharProcs'] = charprocsObject
 fontdict['Encoding'] = {
- 'Type': Name('Encoding'),
+ 'Type': Name('Encoding'), 
 'Differences': differencesArray}
 elif fonttype == 42:
 fontdict['Subtype'] = Name('TrueType')
 fontdict['Encoding'] = Name('WinAnsiEncoding')
 
-
+ 
 flags = 0
 symbolic = False #ps_name.name in ('Cmsy10', 'Cmmi10', 'Cmex10')
 if ff & FIXED_WIDTH: flags |= 1 << 0
@@ -632,7 +632,7 @@
 self.beginStream(charprocObject.id,
 None,
 {'Length': len(stream)})
- self.currentstream.write(stream)
+ self.currentstream.write(stream) 
 self.endStream()
 charprocs[charname] = charprocObject
 self.writeObject(charprocsObject, charprocs)
@@ -755,20 +755,20 @@
 def _rgb(self, im):
 h,w,s = im.as_rgba_str()
 
- rgba = fromstring(s, uint8)
+ rgba = fromstring(s, UInt8)
 rgba.shape = (h, w, 4)
 rgb = rgba[:,:,:3]
 return h, w, rgb.tostring()
 
 def _gray(self, im, rc=0.3, gc=0.59, bc=0.11):
 rgbat = im.as_rgba_str()
- rgba = fromstring(rgbat[2], uint8)
+ rgba = fromstring(rgbat[2], UInt8)
 rgba.shape = (rgbat[0], rgbat[1], 4)
- rgba_f = rgba.astype(float32)
+ rgba_f = rgba.astype(Float32)
 r = rgba_f[:,:,0]
 g = rgba_f[:,:,1]
 b = rgba_f[:,:,2]
- gray = (r*rc + g*gc + b*bc).astype(uint8)
+ gray = (r*rc + g*gc + b*bc).astype(UInt8)
 return rgbat[0], rgbat[1], gray.tostring()
 
 def writeImages(self):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -26,7 +26,7 @@
 
 from matplotlib.transforms import get_vec6_scales
 
-from numpy import uint8, float32, alltrue, array, ceil, equal, \
+from matplotlib.numerix import UInt8, Float32, alltrue, array, ceil, equal, \
 fromstring, nonzero, ones, put, take, where, isnan
 import binascii
 import re
@@ -336,20 +336,20 @@
 def _rgb(self, im):
 h,w,s = im.as_rgba_str()
 
- rgba = fromstring(s, uint8)
+ rgba = fromstring(s, UInt8)
 rgba.shape = (h, w, 4)
 rgb = rgba[:,:,:3]
 return h, w, rgb.tostring()
 
 def _gray(self, im, rc=0.3, gc=0.59, bc=0.11):
 rgbat = im.as_rgba_str()
- rgba = fromstring(rgbat[2], uint8)
+ rgba = fromstring(rgbat[2], UInt8)
 rgba.shape = (rgbat[0], rgbat[1], 4)
- rgba_f = rgba.astype(float32)
+ rgba_f = rgba.astype(Float32)
 r = rgba_f[:,:,0]
 g = rgba_f[:,:,1]
 b = rgba_f[:,:,2]
- gray = (r*rc + g*gc + b*bc).astype(uint8)
+ gray = (r*rc + g*gc + b*bc).astype(UInt8)
 return rgbat[0], rgbat[1], gray.tostring()
 
 def _hex_lines(self, s, chars_per_line=128):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -5,8 +5,9 @@
 
 import matplotlib
 from matplotlib import verbose
-from numpy import asarray, fromstring, zeros, \
- where, transpose, nonzero, indices, ones
+from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
+ where, transpose, nonzero, indices, ones, nx
+import matplotlib.numerix as numerix
 from matplotlib.cbook import is_string_like, enumerate, onetrue
 from matplotlib.font_manager import fontManager
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
@@ -322,7 +323,7 @@
 for text, tooltip_text, image_file, callback in self.toolitems:
 if text is not None:
 qt.QObject.disconnect( self.buttons[ text ],
- qt.SIGNAL( 'clicked()' ),
+ qt.SIGNAL( 'clicked()' ), 
 getattr( self, callback ) )
 
 def pan( self, *args ):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -5,8 +5,9 @@
 
 import matplotlib
 from matplotlib import verbose
-from numpy import asarray, fromstring, zeros, \
- where, transpose, nonzero, indices, ones
+from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
+ where, transpose, nonzero, indices, ones, nx
+import matplotlib.numerix as numerix
 from matplotlib.cbook import is_string_like, enumerate, onetrue
 from matplotlib.font_manager import fontManager
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -10,8 +10,6 @@
 
 import os.path
 
-from numpy import asarray
-
 import matplotlib
 from matplotlib.cbook import is_string_like, enumerate
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
@@ -19,6 +17,7 @@
 
 from matplotlib.figure import Figure
 from matplotlib._pylab_helpers import Gcf
+from matplotlib.numerix import asarray
 
 import matplotlib.windowing as windowing
 from matplotlib.widgets import SubplotTool
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/collections.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -145,14 +145,14 @@
 def contains(self, mouseevent):
 """
 Test whether the mouse event occurred in the collection.
-
+ 
 Returns T/F, dict(ind=itemlist), where every item in itemlist contains the event.
 """
 if callable(self._contains): return self._contains(self,mouseevent)
 # TODO: Consider doing the test in data coordinates
 # Patch transforms the mouse into data coordinates and does the
 # test for membership there. This is more efficient though it
- # may not match the visual appearance of the polygon on the
+ # may not match the visual appearance of the polygon on the 
 # screen. Regardless, patch and patch collection should use
 # the same algorithm. Here's the code in patch:
 #
@@ -338,7 +338,7 @@
 """
 verts is a sequence of ( verts0, verts1, ...) where verts_i is
 a sequence of xy tuples of vertices, or an equivalent
- numpy array of shape (nv,2).
+ numerix array of shape (nv,2).
 
 %(PatchCollection)s
 """
@@ -461,7 +461,7 @@
 def get_transformed_patches(self):
 # Shouldn't need all these calls to asarray;
 # the variables should be converted when stored.
- # Similar speedups with numpy should be attainable
+ # Similar speedups with numerix should be attainable
 # in many other places.
 verts = npy.asarray(self._verts)
 offsets = npy.asarray(self._offsets)
@@ -588,7 +588,7 @@
 """
 segments is a sequence of ( line0, line1, line2), where
 linen = (x0, y0), (x1, y1), ... (xm, ym), or the
- equivalent numpy array with two columns.
+ equivalent numerix array with two columns.
 Each line can be a different length.
 
 colors must be a tuple of RGBA tuples (eg arbitrary color
@@ -616,7 +616,7 @@
 
 norm = None, # optional for ScalarMappable
 cmap = None, # ditto
-
+ 
 pickradius is the tolerance for mouse clicks picking a line. The
 default is 5 pt.
 
@@ -659,7 +659,7 @@
 def contains(self, mouseevent):
 """
 Test whether the mouse event occurred in the collection.
-
+ 
 Returns T/F, dict(ind=itemlist), where every item in itemlist contains the event.
 """
 import matplotlib.lines as ML
@@ -679,7 +679,7 @@
 this_ind = ML.segment_hits(mx,my,xy[:,0],xy[:,1],self.pickradius)
 ind.extend([(this,k) for k in this_ind])
 return len(ind)>0,dict(ind=ind)
-
+ 
 def set_pickradius(self,pickradius): self.pickradius = 5
 def get_pickradius(self): return self.pickradius
 
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/colors.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -432,7 +432,7 @@
 mask_bad = ma.getmask(xma)
 if xa.dtype.char in npy.typecodes['Float']:
 npy.putmask(xa, xa==1.0, 0.9999999) #Treat 1.0 as slightly less than 1.
- xa = (xa * self.N).astype(int)
+ xa = (xa * self.N).astype(npy.int)
 # Set the over-range indices before the under-range;
 # otherwise the under-range values get converted to over-range.
 npy.putmask(xa, xa>self.N-1, self._i_over)
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/figure.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -16,7 +16,8 @@
 
 from legend import Legend
 from transforms import Bbox, Value, Point, get_bbox_transform, unit_bbox
-from numpy import array, clip, transpose, minimum, maximum, linspace, meshgrid
+from numerix import array, clip, transpose, minimum, maximum
+from mlab import linspace, meshgrid
 from ticker import FormatStrFormatter
 from cm import ScalarMappable
 from contour import ContourSet
Modified: trunk/matplotlib/lib/matplotlib/finance.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/finance.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/finance.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -12,8 +12,6 @@
 except ImportError:
 raise SystemExit('The finance module requires datetime support (python2.3)')
 
-import numpy as npy
-
 from matplotlib import verbose, get_configdir
 from artist import Artist
 from dates import date2num, num2date
@@ -22,6 +20,7 @@
 from matplotlib.colors import colorConverter
 from lines import Line2D, TICKLEFT, TICKRIGHT
 from patches import Rectangle
+import matplotlib.numerix as nx
 from matplotlib.transforms import scale_transform, Value, zero, one, \
 scale_sep_transform, blend_xy_sep_transform
 
@@ -77,7 +76,7 @@
 if asobject:
 if len(results)==0: return None
 else:
- date, open, close, high, low, volume = map(npy.asarray, zip(*results))
+ date, open, close, high, low, volume = map(nx.asarray, zip(*results))
 return Bunch(date=date, open=open, close=close, high=high, low=low, volume=volume)
 else:
 
@@ -378,10 +377,10 @@
 )
 closeCollection.set_transform(tickTransform)
 
- minpy, maxx = (0, len(rangeSegments))
+ minx, maxx = (0, len(rangeSegments))
 miny = min([low for low in lows if low !=-1])
 maxy = max([high for high in highs if high != -1])
- corners = (minpy, miny), (maxx, maxy)
+ corners = (minx, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
@@ -467,11 +466,11 @@
 
 
 
- minpy, maxx = (0, len(rangeSegments))
+ minx, maxx = (0, len(rangeSegments))
 miny = min([low for low in lows if low !=-1])
 maxy = max([high for high in highs if high != -1])
 
- corners = (minpy, miny), (maxx, maxy)
+ corners = (minx, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
@@ -534,10 +533,10 @@
 
 
 
- minpy, maxx = (0, len(offsetsBars))
+ minx, maxx = (0, len(offsetsBars))
 miny = 0
 maxy = max([v for v in volumes if v!=-1])
- corners = (minpy, miny), (maxx, maxy)
+ corners = (minx, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
@@ -627,10 +626,10 @@
 
 
 
- minpy, maxx = (min(dates), max(dates))
+ minx, maxx = (min(dates), max(dates))
 miny = 0
 maxy = max([volume for d, open, close, high, low, volume in quotes])
- corners = (minpy, miny), (maxx, maxy)
+ corners = (minx, miny), (maxx, maxy)
 ax.update_datalim(corners)
 #print 'datalim', ax.dataLim.get_bounds()
 #print 'viewlim', ax.viewLim.get_bounds()
@@ -684,10 +683,10 @@
 
 
 
- minpy, maxx = (0, len(offsetsBars))
+ minx, maxx = (0, len(offsetsBars))
 miny = 0
 maxy = max([v for v in vals if v!=-1])
- corners = (minpy, miny), (maxx, maxy)
+ corners = (minx, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/image.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -9,8 +9,9 @@
 from artist import Artist
 from colors import colorConverter
 import cm
+import numerix
 import numerix.ma as ma
-from numpy import arange, asarray, uint8, float32, repeat, newaxis, fromstring
+from numerix import arange, asarray, UInt8, Float32, repeat, NewAxis, typecode
 import _image
 
 
@@ -116,7 +117,7 @@
 raise RuntimeError('You must first set the image array or the image attribute')
 
 if self._imcache is None:
- if self._A.dtype == uint8 and len(self._A.shape) == 3:
+ if typecode(self._A) == UInt8 and len(self._A.shape) == 3:
 im = _image.frombyte(self._A, 0)
 im.is_grayscale = False
 else:
@@ -185,7 +186,7 @@
 """Test whether the mouse event occured within the image.
 """
 if callable(self._contains): return self._contains(self,mouseevent)
- # TODO: make sure this is consistent with patch and patch
+ # TODO: make sure this is consistent with patch and patch 
 # collection on nonlinear transformed coordinates.
 # TODO: consider returning image coordinates (shouldn't
 # be too difficult given that the image is rectilinear
@@ -196,7 +197,7 @@
 inside = xdata>=xmin and xdata<=xmax and ydata>=ymin and ydata<=ymax
 else:
 inside = False
-
+ 
 return inside,{}
 
 def write_png(self, fname, noscale=False):
@@ -332,8 +333,8 @@
 return im
 
 def set_data(self, x, y, A):
- x = asarray(x,float32)
- y = asarray(y,float32)
+ x = asarray(x).astype(Float32)
+ y = asarray(y).astype(Float32)
 A = asarray(A)
 if len(x.shape) != 1 or len(y.shape) != 1\
 or A.shape[0:2] != (y.shape[0], x.shape[0]):
@@ -345,16 +346,16 @@
 if len(A.shape) == 3 and A.shape[2] == 1:
 A.shape = A.shape[0:2]
 if len(A.shape) == 2:
- if A.dtype != uint8:
- A = (self.cmap(self.norm(A))*255).astype(uint8)
+ if typecode(A) != UInt8:
+ A = (self.cmap(self.norm(A))*255).astype(UInt8)
 else:
- A = repeat(A[:,:,newaxis], 4, 2)
+ A = repeat(A[:,:,NewAxis], 4, 2)
 A[:,:,3] = 255
 else:
- if A.dtype != uint8:
- A = (255*A).astype(uint8)
+ if typecode(A) != UInt8:
+ A = (255*A).astype(UInt8)
 if A.shape[2] == 3:
- B = zeros(tuple(list(A.shape[0:2]) + [4]), uint8)
+ B = zeros(tuple(list(A.shape[0:2]) + [4]), UInt8)
 B[:,:,0:3] = A
 B[:,:,3] = 255
 A = B
@@ -427,7 +428,7 @@
 inside = xdata>=xmin and xdata<=xmax and ydata>=ymin and ydata<=ymax
 else:
 inside = False
-
+ 
 return inside,{}
 
 def get_size(self):
@@ -440,7 +441,7 @@
 def get_extent(self):
 'get the image extent: left, right, bottom, top'
 numrows, numcols = self.get_size()
- return (-0.5+self.ox, numcols-0.5+self.ox,
+ return (-0.5+self.ox, numcols-0.5+self.ox, 
 -0.5+self.oy, numrows-0.5+self.oy)
 
 def make_image(self, magnification=1.0):
@@ -476,7 +477,7 @@
 
 def imread(fname):
 """
- return image file in fname as numpy array
+ return image file in fname as numerix array
 
 Return value is a MxNx4 array of 0-1 normalized floats
 
@@ -503,6 +504,6 @@
 raise RuntimeError('Unknown image mode')
 
 x_str = im.tostring('raw',im.mode,0,-1)
- x = fromstring(x_str,uint8)
+ x = numerix.fromstring(x_str,numerix.UInt8)
 x.shape = im.size[1], im.size[0], 4
 return x
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/legend.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -22,7 +22,7 @@
 """
 from __future__ import division
 import sys, warnings
-from numpy import array, ones, linspace
+from numerix import array, ones, Float
 
 
 from matplotlib import verbose, rcParams
@@ -30,7 +30,7 @@
 from cbook import enumerate, is_string_like, iterable, silent_list
 from font_manager import FontProperties
 from lines import Line2D
-from mlab import segments_intersect
+from mlab import linspace, segments_intersect
 from patches import Patch, Rectangle, RegularPolygon, Shadow, bbox_artist, draw_bbox
 from collections import LineCollection, RegularPolyCollection, PatchCollection
 from text import Text
@@ -280,7 +280,7 @@
 x, y = label.get_position()
 x -= self.handlelen + self.handletextsep
 if isinstance(handle, Line2D):
- ydata = (y-HEIGHT/2)*ones(self._xdata.shape, float)
+ ydata = (y-HEIGHT/2)*ones(self._xdata.shape, Float)
 legline = Line2D(self._xdata, ydata)
 legline.update_from(handle)
 self._set_artist_props(legline) # after update
@@ -298,7 +298,7 @@
 p.set_clip_box(None)
 ret.append(p)
 elif isinstance(handle, LineCollection):
- ydata = (y-HEIGHT/2)*ones(self._xdata.shape, float)
+ ydata = (y-HEIGHT/2)*ones(self._xdata.shape, Float)
 legline = Line2D(self._xdata, ydata)
 self._set_artist_props(legline)
 legline.set_clip_box(None)
@@ -555,7 +555,7 @@
 for handle, tup in zip(self.legendHandles, hpos):
 y,h = tup
 if isinstance(handle, Line2D):
- ydata = y*ones(self._xdata.shape, float)
+ ydata = y*ones(self._xdata.shape, Float)
 handle.set_ydata(ydata+h/2)
 elif isinstance(handle, Rectangle):
 handle.set_y(y+1/4*h)
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/lines.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -9,10 +9,10 @@
 import sys, math, warnings
 
 import agg
-from numpy import alltrue, arange, array, logical_and, \
+from numerix import Float, alltrue, arange, array, logical_and, \
 nonzero, searchsorted, take, asarray, ones, where, less, ravel, \
 greater, cos, sin, pi, sqrt, less_equal, \
- compress, zeros, concatenate, cumsum, newaxis
+ compress, zeros, concatenate, cumsum, typecode, NewAxis
 import numerix.ma as ma
 from matplotlib import verbose
 import artist
@@ -64,12 +64,12 @@
 if len(i1) == 0:
 return None
 if not compressed:
- return concatenate((i0[:, newaxis], i1[:, newaxis]), axis=1)
+ return concatenate((i0[:, NewAxis], i1[:, NewAxis]), axis=1)
 seglengths = i1 - i0
 breakpoints = cumsum(seglengths)
 ic0 = concatenate(((0,), breakpoints[:-1]))
 ic1 = breakpoints
- return concatenate((ic0[:, newaxis], ic1[:, newaxis]), axis=1)
+ return concatenate((ic0[:, NewAxis], ic1[:, NewAxis]), axis=1)
 
 def segment_hits(cx,cy,x,y,radius):
 """Determine if any line segments are within radius of a point. Returns
@@ -88,7 +88,7 @@
 u = ( (cx-xr)*dx + (cy-yr)*dy )/Lnorm_sq
 candidates = (u>=0) & (u<=1)
 #if any(candidates): print "candidates",xr[candidates]
-
+ 
 # Note that there is a little area near one side of each point
 # which will be near neither segment, and another which will
 # be near both, depending on the angle of the lines. The
@@ -96,7 +96,7 @@
 point_hits = (cx - x)**2 + (cy - y)**2 <= radius**2
 #if any(point_hits): print "points",xr[candidates]
 candidates = candidates & ~point_hits[:-1] & ~point_hits[1:]
-
+ 
 # For those candidates which remain, determine how far they lie away
 # from the line.
 px,py = xr+u*dx,yr+u*dy
@@ -164,7 +164,7 @@
 else:
 return "Line2D(%s)"\
 %(",".join(["(%g,%g)"%(x,y) for x,y in zip(self._x,self._y)]))
-
+ 
 def __init__(self, xdata, ydata,
 linewidth = None, # all Nones default to rc
 linestyle = None,
@@ -274,25 +274,25 @@
 
 self.set_data(xdata, ydata)
 self._logcache = None
-
+ 
 # TODO: do we really need 'newstyle'
 self._newstyle = False
 
 def contains(self, mouseevent):
 """Test whether the mouse event occurred on the line. The pick radius determines
 the precision of the location test (usually within five points of the value). Use
- get/set pickradius() to view or modify it.
-
- Returns True if any values are within the radius along with {'ind': pointlist},
+ get/set pickradius() to view or modify it. 
+ 
+ Returns True if any values are within the radius along with {'ind': pointlist}, 
 where pointlist is the set of points within the radius.
-
+ 
 TODO: sort returned indices by distance
 """
 if callable(self._contains): return self._contains(self,mouseevent)
-
+ 
 if not is_numlike(self.pickradius):
 raise ValueError,"pick radius should be a distance"
-
+ 
 if self._newstyle:
 # transform in backend
 x = self._x
@@ -308,7 +308,7 @@
 pixels = self.pickradius
 else:
 pixels = self.figure.dpi.get()/72. * self.pickradius
-
+ 
 if self._linestyle == 'None':
 # If no line, return the nearby point(s)
 d = sqrt((xt-mouseevent.x)**2 + (yt-mouseevent.y)**2)
@@ -322,21 +322,21 @@
 print 'd', (xt-mouseevent.x)**2., (yt-mouseevent.y)**2.
 print d, pixels, ind
 return len(ind)>0,dict(ind=ind)
-
+ 
 def get_pickradius(self):
 'return the pick radius used for containment tests'
 return self.pickradius
 
- def set_pickradius(self,d):
+ def set_pickradius(self,d): 
 """Sets the pick radius used for containment tests
-
+ 
 Accepts: float distance in points.
 """
 self.pickradius = d
-
+ 
 def set_picker(self,p):
 """Sets the event picker details for the line.
-
+ 
 Accepts: float distance in points or callable pick function fn(artist,event)
 """
 if callable(p):
@@ -344,7 +344,7 @@
 else:
 self.pickradius = p
 self._picker = p
-
+ 
 def get_window_extent(self, renderer):
 self._newstyle = hasattr(renderer, 'draw_markers')
 if self._newstyle:
@@ -398,15 +398,15 @@
 def recache(self):
 #if self.axes is None: print 'recache no axes'
 #else: print 'recache units', self.axes.xaxis.units, self.axes.yaxis.units
- x = ma.asarray(self.convert_xunits(self._xorig), float)
- y = ma.asarray(self.convert_yunits(self._yorig), float)
+ x = ma.asarray(self.convert_xunits(self._xorig), Float)
+ y = ma.asarray(self.convert_yunits(self._yorig), Float)
 
 x = ma.ravel(x)
 y = ma.ravel(y)
 if len(x)==1 and len(y)>1:
- x = x * ones(y.shape, float)
+ x = x * ones(y.shape, Float)
 if len(y)==1 and len(x)>1:
- y = y * ones(x.shape, float)
+ y = y * ones(x.shape, Float)
 
 if len(x) != len(y):
 raise RuntimeError('xdata and ydata must be the same length')
@@ -421,8 +421,8 @@
 else:
 self._segments = None
 
- self._x = asarray(x, float)
- self._y = asarray(y, float)
+ self._x = asarray(x, Float)
+ self._y = asarray(y, Float)
 
 self._logcache = None
 
@@ -557,7 +557,7 @@
 else:
 return self._markerfacecolor
 
-
+ 
 def get_markersize(self): return self._markersize
 
 def get_xdata(self, orig=True):
@@ -708,9 +708,9 @@
 def _draw_steps(self, renderer, gc, xt, yt):
 siz=len(xt)
 if siz<2: return
- xt2=ones((2*siz,), xt.dtype)
+ xt2=ones((2*siz,), typecode(xt))
 xt2[0:-1:2], xt2[1:-1:2], xt2[-1]=xt, xt[1:], xt[-1]
- yt2=ones((2*siz,), yt.dtype)
+ yt2=ones((2*siz,), typecode(yt))
 yt2[0:-1:2], yt2[1::2]=yt, yt
 gc.set_linestyle('solid')
 
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -143,6 +143,7 @@
 from matplotlib.font_manager import fontManager, FontProperties
 from matplotlib._mathtext_data import latex_to_bakoma, cmkern, \
 latex_to_standard, tex2uni, type12uni, tex2type1, uni2type1
+from matplotlib.numerix import absolute
 from matplotlib import get_data_path, rcParams
 
 # symbols that have the sub and superscripts over/under
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py	2007年07月19日 20:24:30 UTC (rev 3579)
+++ trunk/matplotlib/lib/matplotlib/mlab.py	2007年07月20日 02:10:43 UTC (rev 3580)
@@ -71,8 +71,8 @@
 multiply, transpose, ravel, repeat, resize, reshape, floor, ceil,\
 absolute, matrixmultiply, power, take, where, Float, Int, asum,\
 dot, convolve, pi, Complex, ones, zeros, diagonal, Matrix, nonzero, \
- log, searchsorted, concatenate, sort, ArrayType, ndarray, clip, size, indices,\
- conjugate, typecode, iscontiguous, linspace, meshgrid
+ log, searchsorted, concatenate, sort, ArrayType, clip, size, indices,\
+ conjugate, typecode, iscontiguous
 
 
 from numerix.mlab import hanning, cov, diff, svd, rand, std
@@ -93,6 +93,11 @@
 else: return numerix.mlab.mean(x, dim)
 
 
+def linspace(xmin, xmax, N):
+ if N==1: return array([xmax])
+ dx = (xmax-xmin)/(N-1)
+ return xmin + dx*arange(N)
+
 def logspace(xmin,xmax,N):
 return exp(linspace(log(xmin), log(xmax),Nh))
 
@@ -179,7 +184,7 @@
 
 
 # for real x, ignore the negative frequencies
- if npy.iscomplexobj(x): numFreqs = NFFT
+ if typecode(x)==Complex: numFreqs = NFFT
 else: numFreqs = NFFT//2+1
 
 if iterable(window):
@@ -190,7 +195,7 @@
 step = NFFT-noverlap
 ind = range(0,len(x)-NFFT+1,step)
 n = len(ind)
- Pxx = zeros((numFreqs,n), float)
+ Pxx = zeros((numFreqs,n), Float)
 # do the ffts of the slices
 for i in range(n):
 thisX = x[ind[i]:ind[i]+NFFT]
@@ -238,7 +243,7 @@
 
 if NFFT % 2:
 raise ValueError, 'NFFT must be a power of 2'
-
+ 
 x = asarray(x) # make sure we're dealing with a numpy array
 y = asarray(y) # make sure we're dealing with a numpy array
 
@@ -253,7 +258,7 @@
 y[n:] = 0
 
 # for real x, ignore the negative frequencies
- if npy.iscomplexobj(x): numFreqs = NFFT
+ if typecode(x)==Complex: numFreqs = NFFT
 else: numFreqs = NFFT//2+1
 
 if iterable(window):
@@ -264,7 +269,7 @@
 step = NFFT-noverlap
 ind = range(0,len(x)-NFFT+1,step)
 n = len(ind)
- Pxy = zeros((numFreqs,n), complex)
+ Pxy = zeros((numFreqs,n), Complex)
 
 # do the ffts of the slices
 for i in range(n):
@@ -537,7 +542,7 @@
 del seen
 
 # for real X, ignore the negative frequencies
- if npy.iscomplexobj(X): numFreqs = NFFT
+ if typecode(X)==Complex: numFreqs = NFFT
 else: numFreqs = NFFT//2+1
 
 # cache the FFT of every windowed, detrended NFFT length segement
@@ -557,7 +562,7 @@
 normVal = norm(windowVals)**2
 for iCol in allColumns:
 progressCallback(i/Ncols, 'Cacheing FFTs')
- Slices = zeros( (numSlices,numFreqs), complex)
+ Slices = zeros( (numSlices,numFreqs), Complex)
 for iSlice in slices:
 thisSlice = X[ind[iSlice]:ind[iSlice]+NFFT, iCol]
 thisSlice = windowVals*detrend(thisSlice)
@@ -613,7 +618,7 @@
 
 
 n,bins = hist(y, bins)
- n = n.astype(float)
+ n = n.astype(Float)
 
 n = take(n, nonzero(n)) # get the positive
 
@@ -686,14 +691,14 @@
 dx = x[1]-x[0]
 
 
- f = 1/(N*dx)*arange(-N/2, N/2, float)
+ f = 1/(N*dx)*arange(-N/2, N/2, Float)
 
- ind = concatenate([arange(N/2, N, int),
- arange(0, N/2, int)])
+ ind = concatenate([arange(N/2, N, Int),
+ arange(N/2,Int)])
 df = f[1]-f[0]
 cfl = exp(-gamma*absolute(2*pi*f)**alpha)
 
- px = fft(take(cfl,ind)*df).astype(float)
+ px = fft(take(cfl,ind)*df).astype(Float)
 return take(px, ind)
 
 
@@ -753,7 +758,7 @@
 if len(ind)==0: return arange(len(x))
 if len(ind)==len(x): return array([])
 
- y = zeros( (len(x)+2,), int)
+ y = zeros( (len(x)+2,), Int)
 y[1:-1] = x
 d = diff(y)
 #print 'd', d
@@ -806,7 +811,7 @@
 return x[int(p*Nx/100.0)]
 
 p = multiply(array(p), Nx/100.0)
- ind = p.astype(int)
+ ind = p.astype(Int)
 ind = where(ind>=Nx, Nx-1, ind)
 return take(x, ind)
 
@@ -841,7 +846,7 @@...
 
[truncated message content]
From: <ds...@us...> - 2007年07月19日 21:39:58
Revision: 3579
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3579&view=rev
Author: dsdale
Date: 2007年07月19日 13:24:30 -0700 (2007年7月19日)
Log Message:
-----------
fix polar plots, recovered two lines accidentally deleted in _backend_agg.cpp
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/texmanager.py
 trunk/matplotlib/mpl1/mtraits.py
 trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/lib/matplotlib/texmanager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/texmanager.py	2007年07月19日 18:40:08 UTC (rev 3578)
+++ trunk/matplotlib/lib/matplotlib/texmanager.py	2007年07月19日 20:24:30 UTC (rev 3579)
@@ -134,7 +134,8 @@
 self.font_info[font.lower()])
 break
 else:
- warnings.warn('No LaTeX-compatible font found for the %s font family in rcParams. Using default.' % ff)
+ mpl.verbose.report('No LaTeX-compatible font found for \
+the %s font family in rcParams. Using default.' % ff, 'helpful')
 setattr(self, font_family_attr, font_family)
 fontconfig.append(getattr(self, font_family_attr)[0])
 self._fontconfig = ''.join(fontconfig)
Modified: trunk/matplotlib/mpl1/mtraits.py
===================================================================
--- trunk/matplotlib/mpl1/mtraits.py	2007年07月19日 18:40:08 UTC (rev 3578)
+++ trunk/matplotlib/mpl1/mtraits.py	2007年07月19日 20:24:30 UTC (rev 3579)
@@ -8,7 +8,8 @@
 wget http://peak.telecommunity.com/dist/ez_setup.py
 sudo python ez_setup.py
 
- sudo easy_install -f http://code.enthought.com/enstaller/eggs/source/unstable/ "enthought.etsconfig <3.0a" "enthought.util <3.0a" "enthought.debug <3.0a"
+ sudo easy_install -f http://code.enthought.com/enstaller/eggs/source/unstable/ \
+"enthought.etsconfig <3.0a" "enthought.util <3.0a" "enthought.debug <3.0a"
 
 svn co https://svn.enthought.com/svn/enthought/branches/enthought.traits_2.0 enthought_traits
 
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp	2007年07月19日 18:40:08 UTC (rev 3578)
+++ trunk/matplotlib/src/_backend_agg.cpp	2007年07月19日 20:24:30 UTC (rev 3579)
@@ -1528,6 +1528,8 @@
 GCAgg gc = GCAgg(args[0], dpi, snapto);
 
 set_clipbox_rasterizer(gc.cliprect);
+ //path_t transpath(path, xytrans);
+ _process_alpha_mask(gc);
 
 Transformation* mpltransform = static_cast<Transformation*>(args[3].ptr());
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3578
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3578&view=rev
Author: dsdale
Date: 2007年07月19日 11:40:08 -0700 (2007年7月19日)
Log Message:
-----------
update enthought.traits install instructions for mpl1
Modified Paths:
--------------
 trunk/matplotlib/mpl1/mtraits.py
Modified: trunk/matplotlib/mpl1/mtraits.py
===================================================================
--- trunk/matplotlib/mpl1/mtraits.py	2007年07月19日 17:23:41 UTC (rev 3577)
+++ trunk/matplotlib/mpl1/mtraits.py	2007年07月19日 18:40:08 UTC (rev 3578)
@@ -6,9 +6,9 @@
 
 # get easy_install, if necessary
 wget http://peak.telecommunity.com/dist/ez_setup.py
- sudo python sez_setup.py
+ sudo python ez_setup.py
 
- sudo easy_install -f http://code.enthought.com/enstaller/eggs/source/unstable/ enthought.etsconfig enthought.util enthought.debug
+ sudo easy_install -f http://code.enthought.com/enstaller/eggs/source/unstable/ "enthought.etsconfig <3.0a" "enthought.util <3.0a" "enthought.debug <3.0a"
 
 svn co https://svn.enthought.com/svn/enthought/branches/enthought.traits_2.0 enthought_traits
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <nn...@us...> - 2007年07月19日 17:23:44
Revision: 3577
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3577&view=rev
Author: nnemec
Date: 2007年07月19日 10:23:41 -0700 (2007年7月19日)
Log Message:
-----------
completed numpification of most trivial cases
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/art3d.py
 trunk/matplotlib/lib/matplotlib/axes3d.py
 trunk/matplotlib/lib/matplotlib/axis.py
 trunk/matplotlib/lib/matplotlib/axis3d.py
 trunk/matplotlib/lib/matplotlib/backend_bases.py
 trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
 trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
 trunk/matplotlib/lib/matplotlib/backends/backend_gd.py
 trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
 trunk/matplotlib/lib/matplotlib/backends/backend_paint.py
 trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
 trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
 trunk/matplotlib/lib/matplotlib/collections.py
 trunk/matplotlib/lib/matplotlib/figure.py
 trunk/matplotlib/lib/matplotlib/finance.py
 trunk/matplotlib/lib/matplotlib/image.py
 trunk/matplotlib/lib/matplotlib/legend.py
 trunk/matplotlib/lib/matplotlib/lines.py
 trunk/matplotlib/lib/matplotlib/mathtext.py
 trunk/matplotlib/lib/matplotlib/mlab.py
 trunk/matplotlib/lib/matplotlib/proj3d.py
 trunk/matplotlib/lib/matplotlib/texmanager.py
 trunk/matplotlib/lib/matplotlib/text.py
 trunk/matplotlib/lib/matplotlib/units.py
 trunk/matplotlib/lib/matplotlib/widgets.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/CHANGELOG	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -1,5 +1,7 @@
-2007年07月19日 converted non-numpy relicts troughout the code
+2007年07月19日 completed numpification of most trivial cases - NN
 
+2007年07月19日 converted non-numpy relicts troughout the code - NN
+
 2007年07月19日 replaced the Python code in numerix/ by a minimal wrapper around
 numpy that explicitly mentions all symbols that need to be
 	 addressed for further numpification - NN
Modified: trunk/matplotlib/lib/matplotlib/art3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/art3d.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/art3d.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -12,7 +12,7 @@
 from colors import Normalize
 from cm import jet
 
-import numerix as nx
+import numpy as npy
 import proj3d
 
 class Wrap2D:
@@ -254,8 +254,8 @@
 segis.append((si,ei))
 si = ei
 xs,ys,zs = zip(*points)
- ones = nx.ones(len(xs))
- self.vec = nx.array([xs,ys,zs,ones])
+ ones = npy.ones(len(xs))
+ self.vec = npy.array([xs,ys,zs,ones])
 self.segis = segis
 
 def draw3d(self, renderer):
Modified: trunk/matplotlib/lib/matplotlib/axes3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes3d.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/axes3d.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -17,7 +17,7 @@
 from transforms import unit_bbox
 
 import figure
-import numerix as nx
+import numpy as npy
 from colors import Normalize
 
 import art3d
@@ -122,8 +122,8 @@
 self.zz_dataLim.intervalx, self)
 
 def unit_cube(self,vals=None):
- minx,maxx,miny,maxy,minz,maxz = vals or self.get_w_lims()
- xs,ys,zs = ([minx,maxx,maxx,minx,minx,maxx,maxx,minx],
+ minpy,maxx,miny,maxy,minz,maxz = vals or self.get_w_lims()
+ xs,ys,zs = ([minpy,maxx,maxx,minpy,minpy,maxx,maxx,minpy],
 [miny,miny,maxy,maxy,miny,miny,maxy,maxy],
 [minz,minz,minz,minz,maxz,maxz,maxz,maxz])
 return zip(xs,ys,zs)
@@ -186,7 +186,7 @@
 pass
 
 def auto_scale_xyz(self, X,Y,Z=None,had_data=None):
- x,y,z = map(nx.asarray, (X,Y,Z))
+ x,y,z = map(npy.asarray, (X,Y,Z))
 try:
 x,y = X.flat,Y.flat
 if Z is not None:
@@ -216,10 +216,10 @@
 self.set_w_zlim(locator.autoscale())
 
 def get_w_lims(self):
- minx,maxx = self.get_w_xlim()
+ minpy,maxx = self.get_w_xlim()
 miny,maxy = self.get_w_ylim()
 minz,maxz = self.get_w_zlim()
- return minx,maxx,miny,maxy,minz,maxz
+ return minpy,maxx,miny,maxy,minz,maxz
 
 def set_w_zlim(self, *args, **kwargs):
 gl,self.get_xlim = self.get_xlim,self.get_w_zlim
@@ -257,7 +257,7 @@
 def pany(self, numsteps):
 print 'numsteps', numsteps
 
- def panx(self, numsteps):
+ def panpy(self, numsteps):
 print 'numsteps', numsteps
 
 def view_init(self, elev, azim):
@@ -276,7 +276,7 @@
 point.
 
 """
- relev,razim = nx.pi * self.elev/180, nx.pi * self.azim/180
+ relev,razim = npy.pi * self.elev/180, npy.pi * self.azim/180
 
 xmin,xmax = self.get_w_xlim()
 ymin,ymax = self.get_w_ylim()
@@ -288,29 +288,29 @@
 zmin,zmax)
 
 # look into the middle of the new coordinates
- R = nx.array([0.5,0.5,0.5])
+ R = npy.array([0.5,0.5,0.5])
 #
- xp = R[0] + nx.cos(razim)*nx.cos(relev)*self.dist
- yp = R[1] + nx.sin(razim)*nx.cos(relev)*self.dist
- zp = R[2] + nx.sin(relev)*self.dist
+ xp = R[0] + npy.cos(razim)*npy.cos(relev)*self.dist
+ yp = R[1] + npy.sin(razim)*npy.cos(relev)*self.dist
+ zp = R[2] + npy.sin(relev)*self.dist
 
- E = nx.array((xp, yp, zp))
+ E = npy.array((xp, yp, zp))
 #
 self.eye = E
 self.vvec = R - E
 self.vvec = self.vvec / proj3d.mod(self.vvec)
 
- if abs(relev) > nx.pi/2:
+ if abs(relev) > npy.pi/2:
 # upside down
- V = nx.array((0,0,-1))
+ V = npy.array((0,0,-1))
 else:
- V = nx.array((0,0,1))
+ V = npy.array((0,0,1))
 zfront,zback = -self.dist,self.dist
 
 viewM = proj3d.view_transformation(E,R,V)
 perspM = proj3d.persp_transformation(zfront,zback)
- M0 = nx.dot(viewM,worldM)
- M = nx.dot(perspM,M0)
+ M0 = npy.dot(viewM,worldM)
+ M = npy.dot(perspM,M0)
 return M
 
 def mouse_init(self):
@@ -383,8 +383,8 @@
 # scale the z value to match
 x0,y0,z0 = p0
 x1,y1,z1 = p1
- d0 = nx.hypot(x0-xd,y0-yd)
- d1 = nx.hypot(x1-xd,y1-yd)
+ d0 = npy.hypot(x0-xd,y0-yd)
+ d1 = npy.hypot(x1-xd,y1-yd)
 dt = d0+d1
 z = d1/dt * z0 + d0/dt * z1
 #print 'mid', edgei, d0, d1, z0, z1, z
@@ -435,12 +435,12 @@
 elif self.button_pressed == 3:
 # zoom view
 # hmmm..this needs some help from clipping....
- minx,maxx,miny,maxy,minz,maxz = self.get_w_lims()
+ minpy,maxx,miny,maxy,minz,maxz = self.get_w_lims()
 df = 1-((h - dy)/h)
- dx = (maxx-minx)*df
+ dx = (maxx-minpy)*df
 dy = (maxy-miny)*df
 dz = (maxz-minz)*df
- self.set_w_xlim(minx-dx,maxx+dx)
+ self.set_w_xlim(minpy-dx,maxx+dx)
 self.set_w_ylim(miny-dy,maxy+dy)
 self.set_w_zlim(minz-dz,maxz+dz)
 self.get_proj()
@@ -504,14 +504,14 @@
 had_data = self.has_data()
 
 rows, cols = Z.shape
- tX,tY,tZ = nx.transpose(X), nx.transpose(Y), nx.transpose(Z)
+ tX,tY,tZ = npy.transpose(X), npy.transpose(Y), npy.transpose(Z)
 rstride = cbook.popd(kwargs, 'rstride', 10)
 cstride = cbook.popd(kwargs, 'cstride', 10)
 #
 polys = []
 boxes = []
- for rs in nx.arange(0,rows,rstride):
- for cs in nx.arange(0,cols,cstride):
+ for rs in npy.arange(0,rows,rstride):
+ for cs in npy.arange(0,cols,cstride):
 ps = []
 corners = []
 for a,ta in [(X,tX),(Y,tY),(Z,tZ)]:
@@ -522,9 +522,9 @@
 zright = ta[cs][rs:min(rows-1,rs+rstride):]
 zright = zright[::-1]
 corners.append([ztop[0],ztop[-1],zbase[0],zbase[-1]])
- z = nx.concatenate((ztop,zleft,zbase,zright))
+ z = npy.concatenate((ztop,zleft,zbase,zright))
 ps.append(z)
- boxes.append(map(nx.array,zip(*corners)))
+ boxes.append(map(npy.array,zip(*corners)))
 polys.append(zip(*ps))
 #
 lines = []
@@ -533,10 +533,10 @@
 n = proj3d.cross(box[0]-box[1],
 box[0]-box[2])
 n = n/proj3d.mod(n)*5
- shade.append(nx.dot(n,[-1,-1,0.5]))
+ shade.append(npy.dot(n,[-1,-1,0.5]))
 lines.append((box[0],n+box[0]))
 #
- color = nx.array([0,0,1,1])
+ color = npy.array([0,0,1,1])
 norm = Normalize(min(shade),max(shade))
 colors = [color * (0.5+norm(v)*0.5) for v in shade]
 for c in colors: c[3] = 1
@@ -554,7 +554,7 @@
 had_data = self.has_data()
 rows,cols = Z.shape
 
- tX,tY,tZ = nx.transpose(X), nx.transpose(Y), nx.transpose(Z)
+ tX,tY,tZ = npy.transpose(X), npy.transpose(Y), npy.transpose(Z)
 
 rii = [i for i in range(0,rows,rstride)]+[rows-1]
 cii = [i for i in range(0,cols,cstride)]+[cols-1]
@@ -718,7 +718,7 @@
 
 def get_test_data(delta=0.05):
 from mlab import meshgrid, bivariate_normal
- x = y = nx.arange(-3.0, 3.0, delta)
+ x = y = npy.arange(-3.0, 3.0, delta)
 X, Y = meshgrid(x,y)
 
 Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
@@ -764,8 +764,8 @@
 
 def test_plot():
 ax = Axes3D()
- xs = nx.arange(0,4*nx.pi+0.1,0.1)
- ys = nx.sin(xs)
+ xs = npy.arange(0,4*npy.pi+0.1,0.1)
+ ys = npy.sin(xs)
 ax.plot(xs,ys, label='zl')
 ax.plot(xs,ys+max(xs),label='zh')
 ax.plot(xs,ys,dir='x', label='xl')
@@ -785,7 +785,7 @@
 cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.6)
 
 ax = Axes3D()
- xs = nx.arange(0,10,0.4)
+ xs = npy.arange(0,10,0.4)
 verts = []
 zs = [0.0,1.0,2.0,3.0]
 for z in zs:
@@ -817,7 +817,7 @@
 ax = Axes3D()
 
 for c,z in zip(['r','g','b','y'],[30,20,10,0]):
- xs = nx.arange(20)
+ xs = npy.arange(20)
 ys = [random.random() for x in xs]
 ax.bar(xs,ys,z=z,dir='y',color=c)
 #ax.plot(xs,ys)
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/axis.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -7,14 +7,13 @@
 import re
 import sys
 
-from numerix import arange, array, asarray, ones, zeros, \
+from numpy import arange, array, asarray, ones, zeros, \
 nonzero, take, log10, logical_and, \
- dot, sin, cos, tan, pi, sqrt
+ dot, sin, cos, tan, pi, sqrt, linspace
 
 from artist import Artist, setp
 from cbook import enumerate, silent_list, popall, CallbackRegistry
 from lines import Line2D, TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN
-from mlab import linspace
 from matplotlib import rcParams
 from patches import bbox_artist
 from ticker import NullFormatter, FixedFormatter, ScalarFormatter, LogFormatter
Modified: trunk/matplotlib/lib/matplotlib/axis3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis3d.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/axis3d.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -13,7 +13,7 @@
 import art3d
 import proj3d
 
-from numerix import sin, cos, pi, cumsum, dot, asarray, array, \
+from numpy import sin, cos, pi, cumsum, dot, asarray, array, \
 where, nonzero, equal, sqrt
 
 def norm_angle(a):
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -437,7 +437,7 @@
 def points_to_pixels(self, points):
 """
 Convert points to display units
- points - a float or a numerix array of float
+ points - a float or a numpy array of float
 return points converted to pixels
 
 You need to override this function (unless your backend doesn't have a
@@ -891,24 +891,24 @@
 #print "leaving:",[str(a) for a in leave]
 # On leave restore the captured colour
 for a in leave:
- if hasattr(a,'get_color'): 
+ if hasattr(a,'get_color'):
 a.set_color(self._active[a])
- elif hasattr(a,'get_edgecolor'): 
+ elif hasattr(a,'get_edgecolor'):
 a.set_edgecolor(self._active[a][0])
 a.set_facecolor(self._active[a][1])
 del self._active[a]
 # On enter, capture the color and repaint the artist
- # with the highlight colour. Capturing colour has to 
- # be done first in case the parent recolouring affects 
+ # with the highlight colour. Capturing colour has to
+ # be done first in case the parent recolouring affects
 # the child.
 for a in enter:
- if hasattr(a,'get_color'): 
+ if hasattr(a,'get_color'):
 self._active[a] = a.get_color()
 elif hasattr(a,'get_edgecolor'):
 self._active[a] = (a.get_edgecolor(),a.get_facecolor())
 else: self._active[a] = None
 for a in enter:
- if hasattr(a,'get_color'): 
+ if hasattr(a,'get_color'):
 a.set_color('red')
 elif hasattr(a,'get_edgecolor'):
 a.set_edgecolor('red')
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -73,7 +73,7 @@
 import os, sys
 import matplotlib
 from matplotlib import verbose, rcParams
-from numpy import array, zeros, transpose
+from numpy import array, zeros, transpose, fliplr
 from matplotlib._image import fromarray
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase,\
@@ -85,7 +85,6 @@
 from matplotlib.ft2font import FT2Font
 from matplotlib.mathtext import math_parse_s_ft2font
 from matplotlib.transforms import lbwh_to_bbox
-from matplotlib.numerix.mlab import fliplr
 
 from _backend_agg import RendererAgg as _RendererAgg
 
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -17,6 +17,8 @@
 
 import os.path
 
+from numpy import asarray
+
 import matplotlib
 
 from matplotlib import rcParams, verbose
@@ -26,7 +28,6 @@
 NavigationToolbar2, cursors
 from matplotlib.figure import Figure
 from matplotlib._pylab_helpers import Gcf
-from matplotlib.numerix import asarray
 import matplotlib.windowing as windowing
 from matplotlib.widgets import SubplotTool
 
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gd.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gd.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gd.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -12,6 +12,7 @@
 sys.exit()
 
 
+from numpy import ones, array, int16, asarray
 
 from matplotlib.backend_bases import RendererBase, \
 GraphicsContextBase, FigureManagerBase, FigureCanvasBase
@@ -22,7 +23,6 @@
 from matplotlib.figure import Figure
 from matplotlib.transforms import Bbox
 from matplotlib.font_manager import fontManager
-from matplotlib.numerix import ones, array, nx, asarray
 # support old font names
 if (os.environ.has_key('GDFONTPATH') and not
 os.environ.has_key('TTFPATH')):
@@ -115,8 +115,8 @@
 point in x, y
 """
 
- x = x.astype(nx.int16)
- y = self.height*ones(y.shape, nx.int16) - y.astype(nx.int16)
+ x = x.astype(int16)
+ y = self.height*ones(y.shape, int16) - y.astype(int16)
 style = self._set_gd_style(gc)
 self.im.lines( zip(x,y), style)
 self.flush_clip()
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -16,6 +16,9 @@
 % (gtk.pygtk_version + pygtk_version_required))
 del pygtk_version_required
 
+from numpy import amax, asarray, fromstring, int16, uint8, zeros, \
+ where, transpose, nonzero, indices, ones
+
 import matplotlib
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
@@ -23,11 +26,7 @@
 from matplotlib.cbook import is_string_like, enumerate
 from matplotlib.figure import Figure
 from matplotlib.mathtext import math_parse_s_ft2font
-import matplotlib.numerix as numerix
-from matplotlib.numerix import asarray, fromstring, uint8, zeros, \
- where, transpose, nonzero, indices, ones, nx
 
-
 from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
 
 
@@ -144,8 +143,8 @@
 
 def draw_lines(self, gc, x, y, transform=None):
 if gc.gdkGC.line_width > 0:
- x = x.astype(nx.int16)
- y = self.height - y.astype(nx.int16)
+ x = x.astype(int16)
+ y = self.height - y.astype(int16)
 self.gdkDrawable.draw_lines(gc.gdkGC, zip(x,y))
 
 
@@ -222,7 +221,7 @@
 Xall[:,i] = fromstring(image_str, uint8)
 
 # get the max alpha at each pixel
- Xs = numerix.mlab.max(Xall,1)
+ Xs = amax(Xall,axis=1)
 
 # convert it to it's proper shape
 Xs.shape = imh, imw
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_paint.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_paint.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_paint.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -16,8 +16,10 @@
 import sys
 import os
 import paint
+
+from numpy import asarray
+
 from matplotlib import verbose
-from matplotlib.numerix import asarray
 
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase,\
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -26,7 +26,7 @@
 
 from matplotlib.transforms import get_vec6_scales
 
-from matplotlib.numerix import uint8, float32, alltrue, array, ceil, equal, \
+from numpy import uint8, float32, alltrue, array, ceil, equal, \
 fromstring, nonzero, ones, put, take, where, isnan
 import binascii
 import re
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -10,6 +10,8 @@
 
 import os.path
 
+from numpy import asarray
+
 import matplotlib
 from matplotlib.cbook import is_string_like, enumerate
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
@@ -17,7 +19,6 @@
 
 from matplotlib.figure import Figure
 from matplotlib._pylab_helpers import Gcf
-from matplotlib.numerix import asarray
 
 import matplotlib.windowing as windowing
 from matplotlib.widgets import SubplotTool
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/collections.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -145,14 +145,14 @@
 def contains(self, mouseevent):
 """
 Test whether the mouse event occurred in the collection.
- 
+
 Returns T/F, dict(ind=itemlist), where every item in itemlist contains the event.
 """
 if callable(self._contains): return self._contains(self,mouseevent)
 # TODO: Consider doing the test in data coordinates
 # Patch transforms the mouse into data coordinates and does the
 # test for membership there. This is more efficient though it
- # may not match the visual appearance of the polygon on the 
+ # may not match the visual appearance of the polygon on the
 # screen. Regardless, patch and patch collection should use
 # the same algorithm. Here's the code in patch:
 #
@@ -338,7 +338,7 @@
 """
 verts is a sequence of ( verts0, verts1, ...) where verts_i is
 a sequence of xy tuples of vertices, or an equivalent
- numerix array of shape (nv,2).
+ numpy array of shape (nv,2).
 
 %(PatchCollection)s
 """
@@ -461,7 +461,7 @@
 def get_transformed_patches(self):
 # Shouldn't need all these calls to asarray;
 # the variables should be converted when stored.
- # Similar speedups with numerix should be attainable
+ # Similar speedups with numpy should be attainable
 # in many other places.
 verts = npy.asarray(self._verts)
 offsets = npy.asarray(self._offsets)
@@ -588,7 +588,7 @@
 """
 segments is a sequence of ( line0, line1, line2), where
 linen = (x0, y0), (x1, y1), ... (xm, ym), or the
- equivalent numerix array with two columns.
+ equivalent numpy array with two columns.
 Each line can be a different length.
 
 colors must be a tuple of RGBA tuples (eg arbitrary color
@@ -616,7 +616,7 @@
 
 norm = None, # optional for ScalarMappable
 cmap = None, # ditto
- 
+
 pickradius is the tolerance for mouse clicks picking a line. The
 default is 5 pt.
 
@@ -659,7 +659,7 @@
 def contains(self, mouseevent):
 """
 Test whether the mouse event occurred in the collection.
- 
+
 Returns T/F, dict(ind=itemlist), where every item in itemlist contains the event.
 """
 import matplotlib.lines as ML
@@ -679,7 +679,7 @@
 this_ind = ML.segment_hits(mx,my,xy[:,0],xy[:,1],self.pickradius)
 ind.extend([(this,k) for k in this_ind])
 return len(ind)>0,dict(ind=ind)
- 
+
 def set_pickradius(self,pickradius): self.pickradius = 5
 def get_pickradius(self): return self.pickradius
 
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/figure.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -16,8 +16,7 @@
 
 from legend import Legend
 from transforms import Bbox, Value, Point, get_bbox_transform, unit_bbox
-from numerix import array, clip, transpose, minimum, maximum
-from mlab import linspace, meshgrid
+from numpy import array, clip, transpose, minimum, maximum, linspace, meshgrid
 from ticker import FormatStrFormatter
 from cm import ScalarMappable
 from contour import ContourSet
Modified: trunk/matplotlib/lib/matplotlib/finance.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/finance.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/finance.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -12,6 +12,8 @@
 except ImportError:
 raise SystemExit('The finance module requires datetime support (python2.3)')
 
+import numpy as npy
+
 from matplotlib import verbose, get_configdir
 from artist import Artist
 from dates import date2num, num2date
@@ -20,7 +22,6 @@
 from matplotlib.colors import colorConverter
 from lines import Line2D, TICKLEFT, TICKRIGHT
 from patches import Rectangle
-import matplotlib.numerix as nx
 from matplotlib.transforms import scale_transform, Value, zero, one, \
 scale_sep_transform, blend_xy_sep_transform
 
@@ -76,7 +77,7 @@
 if asobject:
 if len(results)==0: return None
 else:
- date, open, close, high, low, volume = map(nx.asarray, zip(*results))
+ date, open, close, high, low, volume = map(npy.asarray, zip(*results))
 return Bunch(date=date, open=open, close=close, high=high, low=low, volume=volume)
 else:
 
@@ -377,10 +378,10 @@
 )
 closeCollection.set_transform(tickTransform)
 
- minx, maxx = (0, len(rangeSegments))
+ minpy, maxx = (0, len(rangeSegments))
 miny = min([low for low in lows if low !=-1])
 maxy = max([high for high in highs if high != -1])
- corners = (minx, miny), (maxx, maxy)
+ corners = (minpy, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
@@ -466,11 +467,11 @@
 
 
 
- minx, maxx = (0, len(rangeSegments))
+ minpy, maxx = (0, len(rangeSegments))
 miny = min([low for low in lows if low !=-1])
 maxy = max([high for high in highs if high != -1])
 
- corners = (minx, miny), (maxx, maxy)
+ corners = (minpy, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
@@ -533,10 +534,10 @@
 
 
 
- minx, maxx = (0, len(offsetsBars))
+ minpy, maxx = (0, len(offsetsBars))
 miny = 0
 maxy = max([v for v in volumes if v!=-1])
- corners = (minx, miny), (maxx, maxy)
+ corners = (minpy, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
@@ -626,10 +627,10 @@
 
 
 
- minx, maxx = (min(dates), max(dates))
+ minpy, maxx = (min(dates), max(dates))
 miny = 0
 maxy = max([volume for d, open, close, high, low, volume in quotes])
- corners = (minx, miny), (maxx, maxy)
+ corners = (minpy, miny), (maxx, maxy)
 ax.update_datalim(corners)
 #print 'datalim', ax.dataLim.get_bounds()
 #print 'viewlim', ax.viewLim.get_bounds()
@@ -683,10 +684,10 @@
 
 
 
- minx, maxx = (0, len(offsetsBars))
+ minpy, maxx = (0, len(offsetsBars))
 miny = 0
 maxy = max([v for v in vals if v!=-1])
- corners = (minx, miny), (maxx, maxy)
+ corners = (minpy, miny), (maxx, maxy)
 ax.update_datalim(corners)
 ax.autoscale_view()
 
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/image.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -9,9 +9,8 @@
 from artist import Artist
 from colors import colorConverter
 import cm
-import numerix
 import numerix.ma as ma
-from numerix import arange, asarray, uint8, float32, repeat, newaxis
+from numpy import arange, asarray, uint8, float32, repeat, newaxis, fromstring
 import _image
 
 
@@ -477,7 +476,7 @@
 
 def imread(fname):
 """
- return image file in fname as numerix array
+ return image file in fname as numpy array
 
 Return value is a MxNx4 array of 0-1 normalized floats
 
@@ -504,6 +503,6 @@
 raise RuntimeError('Unknown image mode')
 
 x_str = im.tostring('raw',im.mode,0,-1)
- x = numerix.fromstring(x_str,numerix.uint8)
+ x = fromstring(x_str,uint8)
 x.shape = im.size[1], im.size[0], 4
 return x
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/legend.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -22,7 +22,7 @@
 """
 from __future__ import division
 import sys, warnings
-from numerix import array, ones
+from numpy import array, ones, linspace
 
 
 from matplotlib import verbose, rcParams
@@ -30,7 +30,7 @@
 from cbook import enumerate, is_string_like, iterable, silent_list
 from font_manager import FontProperties
 from lines import Line2D
-from mlab import linspace, segments_intersect
+from mlab import segments_intersect
 from patches import Patch, Rectangle, RegularPolygon, Shadow, bbox_artist, draw_bbox
 from collections import LineCollection, RegularPolyCollection, PatchCollection
 from text import Text
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/lines.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -9,7 +9,7 @@
 import sys, math, warnings
 
 import agg
-from numerix import alltrue, arange, array, logical_and, \
+from numpy import alltrue, arange, array, logical_and, \
 nonzero, searchsorted, take, asarray, ones, where, less, ravel, \
 greater, cos, sin, pi, sqrt, less_equal, \
 compress, zeros, concatenate, cumsum, newaxis
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -143,7 +143,6 @@
 from matplotlib.font_manager import fontManager, FontProperties
 from matplotlib._mathtext_data import latex_to_bakoma, cmkern, \
 latex_to_standard, tex2uni, type12uni, tex2type1, uni2type1
-from matplotlib.numerix import absolute
 from matplotlib import get_data_path, rcParams
 
 # symbols that have the sub and superscripts over/under
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/mlab.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -72,7 +72,7 @@
 absolute, matrixmultiply, power, take, where, Float, Int, asum,\
 dot, convolve, pi, Complex, ones, zeros, diagonal, Matrix, nonzero, \
 log, searchsorted, concatenate, sort, ArrayType, ndarray, clip, size, indices,\
- conjugate, typecode, iscontiguous
+ conjugate, typecode, iscontiguous, linspace, meshgrid
 
 
 from numerix.mlab import hanning, cov, diff, svd, rand, std
@@ -93,11 +93,6 @@
 else: return numerix.mlab.mean(x, dim)
 
 
-def linspace(xmin, xmax, N):
- if N==1: return array([xmax])
- dx = (xmax-xmin)/(N-1)
- return xmin + dx*arange(N)
-
 def logspace(xmin,xmax,N):
 return exp(linspace(log(xmin), log(xmax),Nh))
 
@@ -863,42 +858,8 @@
 if dim==1: M=transpose(M)
 return M
 
-def meshgrid(x,y):
- """
- For vectors x, y with lengths Nx=len(x) and Ny=len(y), return X, Y
- where X and Y are (Ny, Nx) shaped arrays with the elements of x
- and y repeated to fill the matrix
 
- EG,
 
- [X, Y] = meshgrid([1,2,3], [4,5,6,7])
-
- X =
- 1 2 3
- 1 2 3
- 1 2 3
- 1 2 3
-
-
- Y =
- 4 4 4
- 5 5 5
- 6 6 6
- 7 7 7
- """
-
- x = array(x)
- y = array(y)
- numRows, numCols = len(y), len(x) # yes, reversed
- x.shape = 1, numCols
- X = repeat(x, numRows)
-
- y.shape = numRows,1
- Y = repeat(y, numCols, 1)
- return X, Y
-
-
-
 def rk4(derivs, y0, t):
 """
 Integrate 1D or ND system of ODEs from initial state y0 at sample
Modified: trunk/matplotlib/lib/matplotlib/proj3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/proj3d.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/proj3d.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -7,8 +7,8 @@
 
 from collections import LineCollection
 from patches import Circle
-import numerix as nx
-from numerix import linear_algebra
+import numpy as npy
+import numpy.linalg as linalg
 from math import sqrt
 
 def _hide_cross(a,b):
@@ -17,7 +17,7 @@
 A x B = <Ay*Bz - Az*By, Az*Bx - Ax*Bz, Ax*By - Ay*Bx>
 a x b = [a2b3 - a3b2, a3b1 - a1b3, a1b2 - a2b1]
 """
- return nx.array([a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1] - a[1]*b[0]])
+ return npy.array([a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1] - a[1]*b[0]])
 cross = _hide_cross
 
 def line2d(p0,p1):
@@ -49,7 +49,7 @@
 """
 a,b,c = l
 x0,y0 = p
- return abs((a*x0 + b*y0 + c)/nx.sqrt(a**2+b**2))
+ return abs((a*x0 + b*y0 + c)/npy.sqrt(a**2+b**2))
 
 
 def line2d_seg_dist(p1,p2, p0):
@@ -64,12 +64,12 @@
 
 x21 = p2[0] - p1[0]
 y21 = p2[1] - p1[1]
- x01 = nx.asarray(p0[0]) - p1[0]
- y01 = nx.asarray(p0[1]) - p1[1]
+ x01 = npy.asarray(p0[0]) - p1[0]
+ y01 = npy.asarray(p0[1]) - p1[1]
 
 u = (x01*x21 + y01*y21)/float(abs(x21**2 + y21**2))
- u = nx.clip(u, 0, 1)
- d = nx.sqrt((x01 - u*x21)**2 + (y01 - u*y21)**2)
+ u = npy.clip(u, 0, 1)
+ d = npy.sqrt((x01 - u*x21)**2 + (y01 - u*y21)**2)
 
 return d
 
@@ -86,7 +86,7 @@
 pylab.scatter(xs,ys)
 #
 dist = line2d_seg_dist(p0,p1,(xs[0],ys[0]))
- dist = line2d_seg_dist(p0,p1,nx.array((xs,ys)))
+ dist = line2d_seg_dist(p0,p1,npy.array((xs,ys)))
 for x,y,d in zip(xs,ys,dist):
 c = Circle((x,y),d,fill=0)
 ax.add_patch(c)
@@ -97,13 +97,13 @@
 
 def mod(v):
 """3d vector length"""
- return nx.sqrt(v[0]**2+v[1]**2+v[2]**2)
+ return npy.sqrt(v[0]**2+v[1]**2+v[2]**2)
 
 def world_transformation(xmin,xmax,
 ymin,ymax,
 zmin,zmax):
 dx,dy,dz = (xmax-xmin),(ymax-ymin),(zmax-zmin)
- return nx.array([
+ return npy.array([
 [1.0/dx,0,0,-xmin/dx],
 [0,1.0/dy,0,-ymin/dy],
 [0,0,1.0/dz,-zmin/dz],
@@ -120,11 +120,11 @@
 n = (E - R)
 ## new
 # n /= mod(n)
-# u = nx.cross(V,n)
+# u = npy.cross(V,n)
 # u /= mod(u)
-# v = nx.cross(n,u)
-# Mr = nx.diag([1.]*4)
-# Mt = nx.diag([1.]*4)
+# v = npy.cross(n,u)
+# Mr = npy.diag([1.]*4)
+# Mt = npy.diag([1.]*4)
 # Mr[:3,:3] = u,v,n
 # Mt[:3,-1] = -E
 ## end new
@@ -146,38 +146,38 @@
 [0, 0, 0, 1]]
 ## end old
 
- return nx.dot(Mr,Mt)
+ return npy.dot(Mr,Mt)
 
 def persp_transformation(zfront,zback):
 a = (zfront+zback)/(zfront-zback)
 b = -2*(zfront*zback)/(zfront-zback)
- return nx.array([[1,0,0,0],
+ return npy.array([[1,0,0,0],
 [0,1,0,0],
 [0,0,a,b],
 [0,0,-1,0]
 ])
 
 def proj_transform_vec(vec, M):
- vecw = nx.dot(M,vec)
+ vecw = npy.dot(M,vec)
 w = vecw[3]
 # clip here..
 txs,tys,tzs = vecw[0]/w,vecw[1]/w,vecw[2]/w
 return txs,tys,tzs
 
 def proj_transform_vec_clip(vec, M):
- vecw = nx.dot(M,vec)
+ vecw = npy.dot(M,vec)
 w = vecw[3]
 # clip here..
 txs,tys,tzs = vecw[0]/w,vecw[1]/w,vecw[2]/w
 tis = (vecw[0] >= 0) * (vecw[0] <= 1) * (vecw[1] >= 0) * (vecw[1] <= 1)
- if nx.sometrue( tis ):
+ if npy.sometrue( tis ):
 tis = vecw[1]<1
 return txs,tys,tzs,tis
 
 def inv_transform(xs,ys,zs,M):
- iM = linear_algebra.inverse(M)
+ iM = linalg.inv(M)
 vec = vec_pad_ones(xs,ys,zs)
- vecr = nx.dot(iM,vec)
+ vecr = npy.dot(iM,vec)
 try:
 vecr = vecr/vecr[3]
 except OverflowError:
@@ -187,11 +187,11 @@
 def vec_pad_ones(xs,ys,zs):
 try:
 try:
- vec = nx.array([xs,ys,zs,nx.ones(xs.shape)])
+ vec = npy.array([xs,ys,zs,npy.ones(xs.shape)])
 except (AttributeError,TypeError):
- vec = nx.array([xs,ys,zs,nx.ones((len(xs)))])
+ vec = npy.array([xs,ys,zs,npy.ones((len(xs)))])
 except TypeError:
- vec = nx.array([xs,ys,zs,1])
+ vec = npy.array([xs,ys,zs,1])
 return vec
 
 def proj_transform(xs,ys,zs, M):
@@ -236,13 +236,13 @@
 
 def test_proj_make_M(E=None):
 # eye point
- E = E or nx.array([1,-1,2])*1000
- #E = nx.array([20,10,20])
- R = nx.array([1,1,1])*100
- V = nx.array([0,0,1])
+ E = E or npy.array([1,-1,2])*1000
+ #E = npy.array([20,10,20])
+ R = npy.array([1,1,1])*100
+ V = npy.array([0,0,1])
 viewM = view_transformation(E,R,V)
 perspM = persp_transformation(100,-100)
- M = nx.dot(perspM,viewM)
+ M = npy.dot(perspM,viewM)
 return M
 
 def test_proj():
@@ -251,7 +251,7 @@
 ts = ['%d' % i for i in [0,1,2,3,0,4,5,6,7,4]]
 #xs,ys,zs = [0,1,1,0,0,1,1,0],[0,0,1,1,0,0,1,1],[0,0,0,0,1,1,1,1]
 xs,ys,zs = [0,1,1,0,0, 0,1,1,0,0],[0,0,1,1,0, 0,0,1,1,0],[0,0,0,0,0, 1,1,1,1,1]
- xs,ys,zs = [nx.array(v)*300 for v in (xs,ys,zs)]
+ xs,ys,zs = [npy.array(v)*300 for v in (xs,ys,zs)]
 #
 test_proj_draw_axes(M,s=400)
 txs,tys,tzs = proj_transform(xs,ys,zs,M)
@@ -268,19 +268,19 @@
 pylab.show()
 
 def rot_x(V,alpha):
- cosa,sina = nx.cos(alpha),nx.sin(alpha)
- M1 = nx.array([[1,0,0,0],
+ cosa,sina = npy.cos(alpha),npy.sin(alpha)
+ M1 = npy.array([[1,0,0,0],
 [0,cosa,-sina,0],
 [0,sina,cosa,0],
 [0,0,0,0]])
 #
- return nx.dot(M1,V)
+ return npy.dot(M1,V)
 
 def test_rot():
 V = [1,0,0,1]
- print rot_x(V, nx.pi/6)
+ print rot_x(V, npy.pi/6)
 V = [0,1,0,1]
- print rot_x(V, nx.pi/6)
+ print rot_x(V, npy.pi/6)
 
 
 if __name__ == "__main__":
Modified: trunk/matplotlib/lib/matplotlib/texmanager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/texmanager.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/texmanager.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -18,7 +18,7 @@
 Only supported on *Agg and PS backends currently
 
 
-For raster output, you can get RGBA numerix arrays from TeX expressions
+For raster output, you can get RGBA numpy arrays from TeX expressions
 as follows
 
 texmanager = TexManager()
@@ -78,7 +78,7 @@
 
 dvipngVersion = get_dvipng_version()
 
- # mappable cache of 
+ # mappable cache of
 arrayd = {}
 postscriptd = {}
 pscnt = 0
@@ -90,7 +90,7 @@
 font_family = 'serif'
 font_families = ('serif', 'sans-serif', 'cursive', 'monospace')
 
- font_info = {'new century schoolbook': ('pnc', 
+ font_info = {'new century schoolbook': ('pnc',
 r'\renewcommand{\rmdefault}{pnc}'),
 'bookman': ('pbk', r'\renewcommand{\rmdefault}{pbk}'),
 'times': ('ptm', r'\usepackage{mathptmx}'),
@@ -107,7 +107,7 @@
 'computer modern roman': ('cmr', ''),
 'computer modern sans serif': ('cmss', ''),
 'computer modern typewriter': ('cmtt', '')}
- 
+
 _rc_cache = None
 _rc_cache_keys = ('text.latex.preamble', )\
 + tuple('font.'+n for n in ('family', ) + font_families)
@@ -122,15 +122,15 @@
 else:
 warnings.warn('The %s font family is not compatible with LaTeX. serif will be used by default.' % ff)
 self.font_family = 'serif'
- 
+
 fontconfig = [self.font_family]
 for font_family, font_family_attr in \
 ((ff, ff.replace('-', '_')) for ff in self.font_families):
 for font in rcParams['font.'+font_family]:
- if DEBUG: print 'family: %s, font: %s, info: %s'%(font_family, 
+ if DEBUG: print 'family: %s, font: %s, info: %s'%(font_family,
 font, self.font_info[font.lower()])
 if font.lower() in self.font_info:
- setattr(self, font_family_attr, 
+ setattr(self, font_family_attr,
 self.font_info[font.lower()])
 break
 else:
@@ -165,7 +165,7 @@
 if changed:
 if DEBUG: print 'DEBUG following keys changed:', changed
 for k in changed:
- if DEBUG: 
+ if DEBUG:
 print 'DEBUG %-20s: %-10s -> %-10s' % \
 (k, self._rc_cache[k], rcParams[k])
 # deepcopy may not be necessary, but feels more future-proof
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/text.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -12,7 +12,7 @@
 from font_manager import FontProperties
 from matplotlib import rcParams
 from patches import bbox_artist, YAArrow
-from numerix import sin, cos, pi, cumsum, dot, asarray, array, \
+from numpy import sin, cos, pi, cumsum, dot, asarray, array, \
 where, nonzero, equal, sqrt
 from transforms import lbwh_to_bbox, bbox_all, identity_transform
 from lines import Line2D
Modified: trunk/matplotlib/lib/matplotlib/units.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/units.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/units.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -83,7 +83,7 @@
 """
 convert obj using unit. If obj is a sequence, return the
 converted sequence. The ouput must be a sequence of scalars
- that can be used by the numerix array layer
+ that can be used by the numpy array layer
 """
 return obj
 convert = staticmethod(convert)
Modified: trunk/matplotlib/lib/matplotlib/widgets.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/widgets.py	2007年07月19日 17:04:19 UTC (rev 3576)
+++ trunk/matplotlib/lib/matplotlib/widgets.py	2007年07月19日 17:23:41 UTC (rev 3577)
@@ -7,10 +7,11 @@
 to be to accommodate your widget.
 """
 
-from mlab import linspace, dist
+from numpy import array, linspace
+
+from mlab import dist
 from patches import Circle, Rectangle
 from lines import Line2D
-from numerix import array
 from transforms import blend_xy_sep_transform
 
 class LockDraw:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2007年07月19日 17:04:22
Revision: 3576
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3576&view=rev
Author: jdh2358
Date: 2007年07月19日 10:04:19 -0700 (2007年7月19日)
Log Message:
-----------
working draft
Modified Paths:
--------------
 trunk/matplotlib/mpl1/DESIGN_GOALS
 trunk/matplotlib/mpl1/mpl1.py
 trunk/matplotlib/mpl1/mtraits.py
 trunk/matplotlib/mpl1/scratch.py
 trunk/matplotlib/mpl1/test.py
Modified: trunk/matplotlib/mpl1/DESIGN_GOALS
===================================================================
--- trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 16:53:36 UTC (rev 3575)
+++ trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 17:04:19 UTC (rev 3576)
@@ -24,7 +24,7 @@
 limits -> axes units (AxesCoords.affineview), the transformation from
 axes units to normalized figure units (AxesCoords.affineaxes), and the
 transformation from normalized figure units to display
-(Renderer.affine)
+(Renderer.affinerenderer)
 
 Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
 
Modified: trunk/matplotlib/mpl1/mpl1.py
===================================================================
--- trunk/matplotlib/mpl1/mpl1.py	2007年07月19日 16:53:36 UTC (rev 3575)
+++ trunk/matplotlib/mpl1/mpl1.py	2007年07月19日 17:04:19 UTC (rev 3576)
@@ -5,7 +5,115 @@
 import numpy as npy
 
 import mtraits # some handy traits for mpl
+ 
 
+class Renderer:
+ def __init__(self, width, height):
+ self.width, self.height = width, height
+
+ # almost all renderers assume 0,0 is left, upper, so we'll flip y here by default
+ self.affinerenderer = npy.array(
+ [[width, 0, 0], [0, -height, height], [0, 0, 1]], dtype=npy.float_)
+ self.pathd = dict() # dict mapping path id -> path instance
+ 
+
+ def add_path(self, pathid, path):
+ self.pathd[pathid] = path
+
+ def remove_path(self, pathid):
+ if pathid in self.pathd:
+ del self.pathd[pathid]
+
+ def render_path(self, pathid):
+ pass
+ 
+
+
+class RendererAgg(Renderer):
+ gray = agg.rgba8(128,128,128,255) 
+ white = agg.rgba8(255,255,255,255)
+ blue = agg.rgba8(0,0,255,255)
+ black = agg.rgba8(0,0,0,0)
+
+ def __init__(self, width, height):
+ Renderer.__init__(self, width, height)
+ 
+ stride = width*4
+ self.buf = buf = agg.buffer(width, height, stride)
+
+ self.rbuf = rbuf = agg.rendering_buffer()
+ rbuf.attachb(buf)
+
+ self.pf = pf = agg.pixel_format_rgba(rbuf)
+ self.rbase = rbase = agg.renderer_base_rgba(pf)
+ rbase.clear_rgba8(self.gray)
+
+ # the antialiased renderers
+ self.renderer = agg.renderer_scanline_aa_solid_rgba(rbase); 
+ self.rasterizer = agg.rasterizer_scanline_aa()
+ self.scanline = agg.scanline_p8()
+ self.trans = None
+
+ # the aliased renderers
+ self.rendererbin = agg.renderer_scanline_bin_solid_rgba(rbase);
+ self.scanlinebin = agg.scanline_bin()
+
+
+ def add_path(self, pathid, path):
+ self.pathd[pathid] = AggPath(path)
+
+ def render_path(self, pathid):
+
+
+ path = self.pathd[pathid]
+
+ if path.antialiased:
+ renderer = self.renderer
+ scanline = self.scanline
+ render_scanlines = agg.render_scanlines_rgba
+ else:
+ renderer = self.rendererbin
+ scanline = self.scanlinebin
+ render_scanlines = agg.render_scanlines_bin_rgba
+
+
+ affine = npy.dot(self.affinerenderer, path.affine)
+ #print 'display affine:\n', self.affinerenderer
+ #print 'path affine:\n', path.affine
+ #print 'product affine:\n', affine
+ a, b, tx = affine[0]
+ c, d, ty = affine[1]
+ aggaffine = agg.trans_affine(a,b,c,d,tx,ty)
+ transpath = agg.conv_transform_path(path.agg_path, aggaffine)
+
+ renderer.color_rgba8( path.agg_strokecolor )
+ if path.fillcolor is not None:
+ self.rasterizer.add_path(transpath)
+ renderer.color_rgba8( path.agg_fillcolor )
+ render_scanlines(self.rasterizer, scanline, renderer);
+
+ if path.strokecolor is not None:
+ stroke = agg.conv_stroke_transpath(transpath)
+ stroke.width(path.linewidth)
+ self.rasterizer.add_path(stroke)
+ renderer.color_rgba8( path.agg_strokecolor ) 
+ render_scanlines(self.rasterizer, scanline, renderer);
+
+
+ def show(self):
+ # we'll cheat a little and use pylab for display
+
+ X = npy.fromstring(self.buf.to_string(), npy.uint8)
+ X.shape = self.height, self.width, 4
+ if 1:
+ import pylab
+ fig = pylab.figure()
+ ax = fig.add_axes([0,0,1,1], xticks=[], yticks=[],
+ frameon=False, aspect='auto')
+ ax.imshow(X, aspect='auto')
+ pylab.show()
+
+
 class Func:
 def __call__(self, X):
 'transform the numpy array with shape N,2'
@@ -62,47 +170,67 @@
 """
 MOVETO, LINETO, CLOSEPOLY = range(3)
 
- strokecolor = mtraits.color('black')
- fillcolor = mtraits.color('blue')
- alpha = mtraits.alpha(1.0)
- linewidth = mtraits.linewidth(1.0)
- antialiased = mtraits.flexible_true_trait
- verts= mtraits.verts
- codes = mtraits.codes
+ strokecolor = mtraits.Color('black')
+ fillcolor = mtraits.Color('blue')
+ alpha = mtraits.Alpha(1.0)
+ linewidth = mtraits.Linewidth(1.0)
+ antialiased = mtraits.FlexibleTrueTrait
+ pathdata = mtraits.PathData
+ affine = mtraits.Affine
+ 
+mtraits.Path = traits.Trait(Path())
 
-mtraits.path = traits.Trait(Path())
+class AggPath(Path):
+
+ def __init__(self, path):
+ self.strokecolor = path.strokecolor
+ self.fillcolor = path.fillcolor
+ self.alpha = path.alpha
+ self.linewidth = path.linewidth
+ self.antialiased = path.antialiased
+ self.pathdata = path.pathdata
+ self.affine = path.affine
+
 
-class AggPath:
- def __init__(self, path):
- """
- Path stored with agg data structs 
- """
+ path.sync_trait('strokecolor', self)
+ path.sync_trait('fillcolor', self)
+ path.sync_trait('alpha', self)
+ path.sync_trait('linewidth', self)
+ path.sync_trait('antialiased', self)
+ path.sync_trait('pathdata', self)
+ path.sync_trait('affine', self)
+
+ def _pathdata_changed(self, olddata, newdata):
 MOVETO, LINETO, CLOSEPOLY = Path.MOVETO, Path.LINETO, Path.CLOSEPOLY
- aggpath = agg.path_storage()
- verts = path.verts
- codes = path.codes
- for i in range(len(verts)):
+ agg_path = agg.path_storage()
+ codes, verts = newdata
+ N = len(codes)
+ for i in range(N):
 x, y = verts[i]
 code = codes[i]
 if code==MOVETO:
- aggpath.move_to(x, y)
+ agg_path.move_to(x, y)
 elif code==LINETO:
- aggpath.line_to(x, y) 
+ agg_path.line_to(x, y) 
 elif code==CLOSEPOLY:
- aggpath.close_polygon()
+ agg_path.close_polygon()
+ 
+ self.agg_path = agg_path
+ 
+ def _fillcolor_changed(self, oldcolor, newcolor): 
+ self.agg_fillcolor = self.color_to_rgba8(newcolor)
 
- self.fillcolor = self.color_to_rgba8(path.fillcolor)
- self.strokecolor = self.color_to_rgba8(path.strokecolor)
+ def _strokecolor_changed(self, oldcolor, newcolor): 
 
- self.aggpath = aggpath
- self.alpha = float(path.alpha)
- self.linewidth = float(path.linewidth)
- self.antialiased = bool(path.antialiased)
+ c = self.color_to_rgba8(newcolor)
+ #print 'stroke change: old=%s, new=%s, agg=%s, ret=%s'%(
+ # oldcolor, newcolor, self.agg_strokecolor, c)
+ self.agg_strokecolor = c
 
+
 def color_to_rgba8(self, color):
 if color is None: return None
 rgba = [int(255*c) for c in color.r, color.g, color.b, color.a]
-
 return agg.rgba8(*rgba)
 
 # coordinates:
@@ -111,216 +239,84 @@
 # to a separable cartesian coordinate, eg for polar is takes r,
 # theta -> r*cos(theta), r*sin(theta)
 #
-# affineData : an affine 3x3 matrix that takes model output and
+# AxesCoords.affineview : an affine 3x3 matrix that takes model output and
 # transforms it to axes 0,1. We are kind of stuck with the
 # mpl/matlab convention that 0,0 is the bottom left of the axes,
 # even though it contradicts pretty much every GUI layout in the
 # world
 #
-# affineFigure: an affine 3x3 that transforms an axes.view into figure
+# AxesCoords.affineaxes: an affine 3x3 that transforms an axesview into figure
 # 0,1 
 #
-# affineDisplay : takes an affine 3x3 and puts figure view into display. 0,
+# Renderer.affinerenderer : takes an affine 3x3 and puts figure view into display. 0,
 # 0 is left, top, which is the typical coordinate system of most
 # graphics formats
 
-class Renderer:
- def __init__(self, width, height):
- self.width, self.height = width, height
 
- # almost all renderers assume 0,0 is left, upper, so we'll flip y here by default
- self.displayview = npy.array(
- [[width, 0, 0], [0, -height, height], [0, 0, 1]], dtype=npy.float_)
- self.pathd = dict() # dict mapping path id -> path instance
- 
- def push_affine(self, affine):
- 'set the current affine'
- self.affine = npy.dot(self.displayview, affine)
+class Rectangle(Path):
+ facecolor = mtraits.Color('Yellow')
+ edgecolor = mtraits.Color('Black')
+ edgewidth = mtraits.Linewidth(1.0)
+ 
+ def __init__(self, lbwh, **kwargs):
 
- def add_path(self, pathid, path):
- self.pathd[pathid] = path
+ # support some legacy names
+ self.sync_trait('facecolor', self, 'fillcolor', True)
+ self.sync_trait('edgecolor', self, 'strokecolor', True)
+ self.sync_trait('edgewidth', self, 'strokewidth', True)
 
- def remove_path(self, pathid):
- if pathid in self.pathd:
- del self.pathd[pathid]
+ for k,v in kwargs.items():
+ setattr(self, k, v)
 
- def render_path(self, pathid):
- pass
- 
+ l,b,w,h = lbwh
+ t = b+h
+ r = l+w
+ verts = npy.array([(l,b), (l,t), (r, t), (r, b), (0,0)], npy.float_)
+ codes = Path.LINETO*npy.ones(5, npy.uint8)
+ codes[0] = Path.MOVETO
+ codes[-1] = Path.CLOSEPOLY
 
+ self.pathdata = codes, verts
 
-class RendererAgg(Renderer):
- gray = agg.rgba8(128,128,128,255) 
- white = agg.rgba8(255,255,255,255)
- blue = agg.rgba8(0,0,255,255)
 
- def __init__(self, width, height):
- Renderer.__init__(self, width, height)
 
- self.aggpathd = dict() # map path ids to AggPaths
- stride = width*4
- self.buf = buf = agg.buffer(width, height, stride)
+def Alias(name):
+ return Property(lambda obj: getattr(obj, name),
+ lambda obj, val: setattr(obj, name, val))
 
- self.rbuf = rbuf = agg.rendering_buffer()
- rbuf.attachb(buf)
+class Line(Path):
+ # aliases for matplotlib compat
+ color = mtraits.Color('blue')
+ linewidth = mtraits.Linewidth(1.0)
 
- self.pf = pf = agg.pixel_format_rgba(rbuf)
- self.rbase = rbase = agg.renderer_base_rgba(pf)
- rbase.clear_rgba8(self.gray)
+ 
+ def __init__(self, x, y, model=identity, **kwargs):
+ """
+ The model is a function taking Nx2->Nx2. This is where the
+ nonlinear transformation can be used
+ """
 
- # the antialiased renderers
- self.renderer = agg.renderer_scanline_aa_solid_rgba(rbase); 
- self.rasterizer = agg.rasterizer_scanline_aa()
- self.scanline = agg.scanline_p8()
- self.trans = None
+ self.sync_trait('color', self, 'strokecolor', True)
+ self.sync_trait('linewidth', self, 'strokewidth', True)
 
- # the aliased renderers
- self.rendererbin = agg.renderer_scanline_bin_solid_rgba(rbase);
- self.scanlinebin = agg.scanline_bin()
+ # probably a better way to do this with traits
+ for k,v in kwargs.items():
+ setattr(self, k, v)
 
- def add_path(self, pathid, path):
- Renderer.add_path(self, pathid, path)
- self.aggpathd[pathid] = AggPath(path)
+ X = npy.array([x,y]).T
+ numrows, numcols = X.shape
 
- def remove_path(self, pathid):
- Renderer.remove_path(self, pathid)
- if pathid in self.aggpathd:
- del self.aggpathd[pathid]
+ codes = Path.LINETO*npy.ones(numrows, npy.uint8)
+ codes[0] = Path.MOVETO
 
- def push_affine(self, affine):
- 'set the current affine'
- Renderer.push_affine(self, affine)
- a, b, tx = self.affine[0]
- c, d, ty = self.affine[1]
- self.trans = agg.trans_affine(a,b,c,d,tx,ty)
+ verts = model(X)
 
+ self.pathdata = codes, verts 
+ self.fillcolor = None
 
- def render_path(self, pathid):
- if self.trans is None:
- raise RuntimeError('you must first push_affine')
-
-
-
- aggpath = self.aggpathd[pathid]
-
- if aggpath.antialiased:
- renderer = self.renderer
- scanline = self.scanline
- render_scanlines = agg.render_scanlines_rgba
- else:
- renderer = self.rendererbin
- scanline = self.scanlinebin
- render_scanlines = agg.render_scanlines_bin_rgba
-
- renderer.color_rgba8( aggpath.strokecolor )
- transpath = agg.conv_transform_path(aggpath.aggpath, self.trans)
-
- if aggpath.fillcolor is not None:
- self.rasterizer.add_path(transpath)
- renderer.color_rgba8( aggpath.fillcolor )
- render_scanlines(self.rasterizer, scanline, renderer);
- 
- stroke = agg.conv_stroke_transpath(transpath)
- stroke.width(aggpath.linewidth)
- self.rasterizer.add_path(stroke)
- renderer.color_rgba8( aggpath.strokecolor ) 
- render_scanlines(self.rasterizer, scanline, renderer);
-
-
- def show(self):
- # we'll cheat a little and use pylab for display
-
- X = npy.fromstring(self.buf.to_string(), npy.uint8)
- X.shape = self.height, self.width, 4
- if 1:
- import pylab
- fig = pylab.figure()
- ax = fig.add_axes([0,0,1,1], xticks=[], yticks=[],
- frameon=False, aspect='auto')
- ax.imshow(X, aspect='auto')
- pylab.show()
-
-
-
-
-
-def rectangle(l, b, w, h, facecolor='yellow', edgecolor='black',
- edgewidth=1.0, alpha=1.0):
-
- t = b+h
- r = l+w
- verts = npy.array([(l,b), (l,t), (r, t), (r, b), (0,0)], npy.float_)
- codes = Path.LINETO*npy.ones(5, npy.uint8)
- codes[0] = Path.MOVETO
- codes[-1] = Path.CLOSEPOLY
-
- path = Path()
- part.verts = verts
- path.codes = codes
- path.strokecolor = edgecolor
- path.fillcolor = facecolor
- path.linewidth = edgewidth
- path.alpha = alpha
- return path
-
-def line(x, y, color='black', linewidth=1.0, alpha=1.0, antialiased=True,
- model=identity):
- X = npy.asarray([x,y]).T
- numrows, numcols = X.shape
-
- codes = Path.LINETO*npy.ones(numrows, npy.uint8)
- codes[0] = Path.MOVETO
-
- path = Path()
- path.verts = model(X)
- path.codes = codes 
- path.fillcolor = None
- path.strokecolor = color
- path.strokewidth = linewidth
- path.alpha = alpha
- path.antialiased = antialiased
- return path
- 
 
 
-class AxesCoords(traits.HasTraits):
- xviewlim = mtraits.interval
- yviewlim = mtraits.interval
- affineview = mtraits.affine
- affineaxes = mtraits.affine 
- affine = mtraits.affine 
 
- 
- def _affineview_changed(self, old, new):
- print 'affine view changed'
- self.affine = npy.dot(self.affineaxes, new)
-
- def _affineaxes_changed(self, old, new):
- print 'affine axes changed'
- self.affine = npy.dot(new, self.affineview)
-
- 
- def _xviewlim_changed(self, old, new):
- print 'xviewlim changed'
- xmin, xmax = new
- scale = 1./(xmax-xmin)
- tx = -xmin*scale
- self.affineview[0][0] = scale
- self.affineview[0][-1] = tx
- self.affine = npy.dot(self.affineaxes, self.affineview)
- print '\t', self.affine
- 
- def _yviewlim_changed(self, old, new):
- print 'yviewlim changed'
- ymin, ymax = new
- scale = 1./(ymax-ymin)
- ty = -ymin*scale
- self.affineview[1][1] = scale
- self.affineview[1][-1] = ty
- self.affine = npy.dot(self.affineaxes, self.affineview)
- print '\t', self.affine
- 
-
 class Figure:
 def __init__(self):
 self.renderer = None
@@ -343,9 +339,7 @@
 if self.renderer is None:
 raise RuntimeError('call set_renderer renderer first')
 
- for pathid, path in self.pathd.items():
- print 'path', pathid, path.affine
- renderer.push_affine(path.affine)
+ for pathid in self.pathd:
 renderer.render_path(pathid)
 
 
@@ -384,43 +378,94 @@
 dtype=npy.float_)
 
 
-coords1 = AxesCoords()
-coords1.affineaxes = affine_axes([0.55, 0.55, 0.4, 0.4]) # upper right quadrant
+class AxesCoords(traits.HasTraits):
+ xviewlim = mtraits.Interval
+ yviewlim = mtraits.Interval
+ affineview = mtraits.Affine
+ affineaxes = mtraits.Affine 
+ affine = mtraits.Affine 
 
+ 
+ def _affineview_changed(self, old, new):
+ #print 'affineview changed before:\n', self.affine
+ self.affine = npy.dot(self.affineaxes, new)
+ #print 'affineview changed after:\n', self.affine
 
+ def _affineaxes_changed(self, old, new):
+ #print 'affineaxes changed before:\n', self.affine
+ self.affine = npy.dot(new, self.affineview)
+ #print 'affineaxes changed after:\n', self.affine
+ 
+ def _xviewlim_changed(self, old, new):
 
-fig = Figure()
+ #print 'xviewlim changed before:\n', self.affine
+ xmin, xmax = new
+ scale = 1./(xmax-xmin)
+ tx = -xmin*scale
+ self.affineview[0][0] = scale
+ self.affineview[0][-1] = tx
+ self.affine = npy.dot(self.affineaxes, self.affineview)
+ #print 'xviewlim changed after:\n', self.affine
+ 
+ def _yviewlim_changed(self, old, new):
+ #print 'yviewlim changed before:\n', self.affine
+ ymin, ymax = new
+ scale = 1./(ymax-ymin)
+ ty = -ymin*scale
+ self.affineview[1][1] = scale
+ self.affineview[1][-1] = ty
+ self.affine = npy.dot(self.affineaxes, self.affineview)
+ #print 'yviewlim changed after:\n', self.affine
+ 
 
 x = npy.arange(0, 10, 0.01)
 y1 = npy.cos(2*npy.pi*x)
 y2 = 10*npy.exp(-x)
 
-line1 = line(x, y1, color='blue', linewidth=2.0)
-line1.sync_trait('affine', coords1)
+# the axes rectangle
+axrect1 = [0.1, 0.1, 0.4, 0.4]
+coords1 = AxesCoords()
+coords1.affineaxes = affine_axes(axrect1)
 
+fig = Figure()
+
+line1 = Line(x, y1, color='blue', linewidth=2.0)
+rect1 = Rectangle([0,0,1,1], facecolor='white')
+coords1.sync_trait('affine', line1)
+coords1.sync_trait('affineaxes', rect1, 'affine')
+
+fig.add_path(rect1)
 fig.add_path(line1)
 
-print 'before', line1.affine
 # update the view limits, all the affines should be automagically updated
 coords1.xviewlim = 0, 10
 coords1.yviewlim = -1.1, 1.1
 
-print 'after', line1.affine
 
+# the axes rectangle
+axrect2 = [0.55, 0.55, 0.4, 0.4]
+coords2 = AxesCoords()
+coords2.affineaxes = affine_axes(axrect2)
 
-if 0:
- coords2 = AxesCoords()
- coords2.xviewlim = coords1.xviewlim # share the x axis
- coords2.affineaxes = affine_axes([0.1, 0.1, 0.4, 0.4]) # lower left quadrant
 
+r = npy.arange(0.0, 1.0, 0.01)
+theta = r*4*npy.pi
 
- line2 = line(x, y2, color='red', linewidth=2.0)
- line2.affine = coords2.affine
- coords2.yviewlim = 0, 10
- fig.add_path(line2)
+line2 = Line(r, theta, model=Polar(), color='#ee8d18', linewidth=2.0)
+rect2 = Rectangle([0,0,1,1], facecolor='#d5de9c')
+coords2.sync_trait('affine', line2)
+coords2.sync_trait('affineaxes', rect2, 'affine')
 
+fig.add_path(rect2)
+fig.add_path(line2)
 
-if 0:
+# update the view limits, all the affines should be automagically updated
+coords2.xviewlim = -1.1, 1.1
+coords2.yviewlim = -1.1, 1.1
+
+
+
+if 1:
 renderer = RendererAgg(600,400)
 fig.set_renderer(renderer)
 fig.draw()
Modified: trunk/matplotlib/mpl1/mtraits.py
===================================================================
--- trunk/matplotlib/mpl1/mtraits.py	2007年07月19日 16:53:36 UTC (rev 3575)
+++ trunk/matplotlib/mpl1/mtraits.py	2007年07月19日 17:04:19 UTC (rev 3576)
@@ -32,12 +32,12 @@
 import numpy as npy
 
 doprint = True
-flexible_true_trait = traits.Trait(
+FlexibleTrueTrait = traits.Trait(
 True,
 { 'true': True, 't': True, 'yes': True, 'y': True, 'on': True, True: True,
 'false': False, 'f': False, 'no': False, 'n': False, 'off': False, False: False
 } )
-flexible_false_trait = traits.Trait( False, flexible_true_trait )
+FlexibleFalseTrait = traits.Trait( False, FlexibleTrueTrait )
 
 colors = mcolors.cnames
 
@@ -56,9 +56,9 @@
 self.g = g
 self.b = b
 self.a = a
+
 def __repr__(self):
- return 'r,g,b,a = (%1.2f, %1.2f, %1.2f, %1.2f)'%\
- (self.r, self.g, self.b, self.a)
+ return '(%1.2f, %1.2f, %1.2f, %1.2f)'%(self.r, self.g, self.b, self.a)
 
 def tuple_to_rgba(ob, name, val):
 tup = [float(x) for x in val]
@@ -117,17 +117,18 @@
 )
 
 
-linewidth = traits.Float(0.5)
-linestyle = traits.Trait(*linestyles)
-color = Color
-marker = traits.Trait(*linemarkers)
-markersize = traits.Float(6)
-antialiased = flexible_true_trait
-alpha = traits.Range(0., 1., 0.)
-interval = traits.Array('d', (2,), npy.array([0.0, 1.0], npy.float_))
-affine = traits.Array('d', (3,3),
+Alpha = traits.Float(1.0)
+Linewidth = traits.Float(0.5)
+Linestyle = traits.Trait(*linestyles)
+Color = Color
+Marker = traits.Trait(*linemarkers)
+Markersize = traits.Float(6)
+Antialiased = FlexibleTrueTrait
+Alpha = traits.Range(0., 1., 0.)
+Interval = traits.Array('d', (2,), npy.array([0.0, 1.0], npy.float_))
+Affine = traits.Array('d', (3,3),
 npy.array([[1,0,0],[0,1,0],[0,0,1]], npy.float_))
-verts = traits.Array('d', value=npy.array([[0,0],[0,0]], npy.float_))
-codes = traits.Array('b', value=npy.array([0,0], dtype=npy.uint8))
+Verts = traits.Array('d', value=npy.array([[0,0],[0,0]], npy.float_))
+Codes = traits.Array('b', value=npy.array([0,0], dtype=npy.uint8))
+PathData = traits.Tuple(Codes, Verts)
 
-
Modified: trunk/matplotlib/mpl1/scratch.py
===================================================================
--- trunk/matplotlib/mpl1/scratch.py	2007年07月19日 16:53:36 UTC (rev 3575)
+++ trunk/matplotlib/mpl1/scratch.py	2007年07月19日 17:04:19 UTC (rev 3576)
@@ -1,4 +1,64 @@
 
+class AggPath(Path):
+
+ agg_fillcolor = mtraits.ColorAgg(RendererAgg.blue)
+ agg_strokecolor = mtraits.ColorAgg(RendererAgg.black)
+ agg_path = mtraits.PathAgg 
+
+
+ def __init__(self, path):
+ self.strokecolor = path.strokecolor
+ self.fillcolor = path.fillcolor
+ self.alpha = path.alpha
+ self.linewidth = path.linewidth
+ self.antialiased = path.antialiased
+ self.pathdata = path.pathdata
+ self.affine = path.affine
+
+ 
+ path.sync_trait('strokecolor', self)
+ path.sync_trait('fillcolor', self)
+ path.sync_trait('alpha', self)
+ path.sync_trait('linewidth', self)
+ path.sync_trait('antialiased', self)
+ path.sync_trait('pathdata', self)
+ path.sync_trait('affine', self)
+
+ def _pathdata_changed(self, olddata, newdata):
+ print 'pathdata changed'
+ MOVETO, LINETO, CLOSEPOLY = Path.MOVETO, Path.LINETO, Path.CLOSEPOLY
+ agg_path = agg.path_storage()
+ codes, verts = newdata
+ N = len(codes)
+ for i in range(N):
+ x, y = verts[i]
+ code = codes[i]
+ if code==MOVETO:
+ agg_path.move_to(x, y)
+ elif code==LINETO:
+ agg_path.line_to(x, y) 
+ elif code==CLOSEPOLY:
+ agg_path.close_polygon()
+ 
+ self.agg_path = agg_path
+ 
+ def _fillcolor_changed(self, oldcolor, newcolor): 
+ self.agg_fillcolor = self.color_to_rgba8(newcolor)
+
+ def _strokecolor_changed(self, oldcolor, newcolor): 
+
+ c = self.color_to_rgba8(newcolor)
+ print 'stroke change: old=%s, new=%s, agg=%s, ret=%s'%(
+ oldcolor, newcolor, self.agg_strokecolor, c)
+ self.agg_strokecolor = c
+
+
+ def color_to_rgba8(self, color):
+ if color is None: return None
+ rgba = [int(255*c) for c in color.r, color.g, color.b, color.a]
+ return agg.rgba8(*rgba)
+
+
 class Axis(Artist):
 tickcolor = mtraits.color('black')
 axiscolor = mtraits.color('black')
Modified: trunk/matplotlib/mpl1/test.py
===================================================================
--- trunk/matplotlib/mpl1/test.py	2007年07月19日 16:53:36 UTC (rev 3575)
+++ trunk/matplotlib/mpl1/test.py	2007年07月19日 17:04:19 UTC (rev 3576)
@@ -1,36 +1,50 @@
-import numpy
-from enthought.traits.api import HasTraits, Array, Delegate, Trait
+import numpy as npy
+import enthought.traits.api as traits
 
-Affine = Array('d', (3,3),
- value=numpy.array([[1,0,0], [0,1,0], [0,0,1]], numpy.float_))
 
-class C(HasTraits):
- affine1 = Affine
- affine2 = Affine 
- affine = Affine
+class C(traits.HasTraits):
+ x = traits.Float(0.0)
+ y = traits.Float(1.0)
 
- def _affine1_changed(self, old, new):
- self.affine = numpy.dot(new, self.affine2)
+class MyC(C):
+ xy = traits.Float(0.0)
 
- def _affine2_changed(self, old, new):
- self.affine = numpy.dot(self.affine1, new)
+ def __init__(self, c):
+ self.x = c.x
+ self.y = c.y
 
+ c.sync_trait('x', self)
+ c.sync_trait('y', self)
 
-class D(HasTraits):
- affine = Delegate('c')
- c = Trait(C)
+ def _x_changed(self, old, new):
+ self.xy = self.x * self.y
 
- 
+ def _y_changed(self, old, new):
+ self.xy = self.x * self.y
+
+
+# C objects are created at top level
 c = C()
-d = D()
-d.affine = c.affine
+c.x = 1
+c.y = 1
 
 
-print 'before c', type(c.affine), c.affine
-print 'before d', type(d.affine), d.affine
 
-c.affine1 = numpy.random.rand(3,3)
-print 'after c', type(c.affine), c.affine
-print 'after d', type(d.affine), d.affine
 
 
+class Backend:
+ 
+ def register_c(self, c):
+ # only gets C objects after creation
+ self.myc = MyC(c)
+
+backend = Backend()
+
+backend.register_c(c)
+
+c.x = 4
+
+print backend.myc.xy
+
+
+ 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <nn...@us...> - 2007年07月19日 16:53:43
Revision: 3575
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3575&view=rev
Author: nnemec
Date: 2007年07月19日 09:53:36 -0700 (2007年7月19日)
Log Message:
-----------
converted many non-numpy relicts
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/axes3d.py
 trunk/matplotlib/lib/matplotlib/axis.py
 trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
 trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py
 trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
 trunk/matplotlib/lib/matplotlib/backends/backend_gd.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/colors.py
 trunk/matplotlib/lib/matplotlib/image.py
 trunk/matplotlib/lib/matplotlib/legend.py
 trunk/matplotlib/lib/matplotlib/lines.py
 trunk/matplotlib/lib/matplotlib/mlab.py
 trunk/matplotlib/lib/matplotlib/numerix/__init__.py
 trunk/matplotlib/lib/matplotlib/patches.py
 trunk/matplotlib/lib/matplotlib/proj3d.py
 trunk/matplotlib/lib/matplotlib/table.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/CHANGELOG	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -1,3 +1,5 @@
+2007年07月19日 converted non-numpy relicts troughout the code
+
 2007年07月19日 replaced the Python code in numerix/ by a minimal wrapper around
 numpy that explicitly mentions all symbols that need to be
 	 addressed for further numpification - NN
Modified: trunk/matplotlib/lib/matplotlib/axes3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes3d.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/axes3d.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -309,8 +309,8 @@
 
 viewM = proj3d.view_transformation(E,R,V)
 perspM = proj3d.persp_transformation(zfront,zback)
- M0 = nx.matrixmultiply(viewM,worldM)
- M = nx.matrixmultiply(perspM,M0)
+ M0 = nx.dot(viewM,worldM)
+ M = nx.dot(perspM,M0)
 return M
 
 def mouse_init(self):
Modified: trunk/matplotlib/lib/matplotlib/axis.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axis.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/axis.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -8,7 +8,7 @@
 import sys
 
 from numerix import arange, array, asarray, ones, zeros, \
- nonzero, take, Float, log10, logical_and, \
+ nonzero, take, log10, logical_and, \
 dot, sin, cos, tan, pi, sqrt
 
 from artist import Artist, setp
@@ -118,7 +118,7 @@
 
 def contains(self, mouseevent):
 """Test whether the mouse event occured in the Tick marks.
- 
+
 This function always returns false. It is more useful to test if the
 axis as a whole contains the mouse rather than the set of tick marks.
 """
@@ -492,7 +492,7 @@
 LABELPAD = 5
 OFFSETTEXTPAD = 3
 
- def __str__(self): 
+ def __str__(self):
 return str(self.__class__).split('.')[-1] \
 + "(%d,%d)"%self.axes.transAxes.xy_tup((0,0))
 
@@ -657,7 +657,7 @@
 def get_offset_text(self):
 'Return the axis offsetText as a Text instance'
 return self.offsetText
- 
+
 def get_pickradius(self):
 'Return the depth of the axis used by the picker'
 return self.pickradius
@@ -901,11 +901,11 @@
 self.minor.locator = locator
 self.minor.locator.set_view_interval( self.get_view_interval() )
 self.minor.locator.set_data_interval( self.get_data_interval() )
- 
+
 def set_pickradius(self, pickradius):
 """
 Set the depth of the axis used by the picker
- 
+
 ACCEPTS: a distance in points
 """
 self.pickradius = pickradius
@@ -967,12 +967,12 @@
 
 class XAxis(Axis):
 __name__ = 'xaxis'
- 
+
 def contains(self,mouseevent):
 """Test whether the mouse event occured in the x axis.
 """
 if callable(self._contains): return self._contains(self,mouseevent)
- 
+
 xpixel,ypixel = mouseevent.x,mouseevent.y
 try:
 xaxes,yaxes = self.axes.transAxes.inverse_xy_tup((xpixel,ypixel))
@@ -1155,11 +1155,11 @@
 
 def contains(self,mouseevent):
 """Test whether the mouse event occurred in the y axis.
- 
+
 Returns T/F, {}
 """
 if callable(self._contains): return self._contains(self,mouseevent)
- 
+
 xpixel,ypixel = mouseevent.x,mouseevent.y
 try:
 xaxes,yaxes = self.axes.transAxes.inverse_xy_tup((xpixel,ypixel))
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -73,7 +73,7 @@
 import os, sys
 import matplotlib
 from matplotlib import verbose, rcParams
-from matplotlib.numerix import array, Float, zeros, transpose
+from numpy import array, zeros, transpose
 from matplotlib._image import fromarray
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase,\
@@ -154,8 +154,8 @@
 point in x, y
 """
 if __debug__: verbose.report('RendererAgg.draw_line', 'debug-annoying')
- x = array([x1,x2], typecode=Float)
- y = array([y1,y2], typecode=Float)
+ x = array([x1,x2], float)
+ y = array([y1,y2], float)
 self._renderer.draw_lines(gc, x, y)
 
 
@@ -273,7 +273,7 @@
 def func(x):
 return transpose(fliplr(x))
 
- Z = zeros((n,m,4), typecode=Float)
+ Z = zeros((n,m,4), float)
 Z[:,:,0] = func(r)
 Z[:,:,1] = func(g)
 Z[:,:,2] = func(b)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_agg2.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -8,7 +8,7 @@
 import matplotlib.agg as agg
 
 from matplotlib import verbose
-from matplotlib.numerix import array, Float
+from numpy import array
 
 from matplotlib._pylab_helpers import Gcf
 from matplotlib.backend_bases import RendererBase,\
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -38,7 +38,7 @@
 from matplotlib.cbook import enumerate, izip
 from matplotlib.figure import Figure
 from matplotlib.mathtext import math_parse_s_ft2font
-import matplotlib.numerix as numx
+import numpy as npy
 from matplotlib.transforms import Bbox
 from matplotlib import rcParams
 
@@ -137,8 +137,8 @@
 ctx.rotate(rotation)
 ctx.scale(width / 2.0, height / 2.0)
 ctx.new_sub_path()
- ctx.arc(0.0, 0.0, 1.0, numx.pi * angle1 / 180.,
- numx.pi * angle2 / 180.)
+ ctx.arc(0.0, 0.0, 1.0, npy.pi * angle1 / 180.,
+ npy.pi * angle2 / 180.)
 ctx.restore()
 
 self._fill_and_stroke (ctx, rgbFace)
@@ -243,7 +243,7 @@
 # render by drawing a 0.5 radius circle
 ctx = gc.ctx
 ctx.new_path()
- ctx.arc (x, self.height - y, 0.5, 0, 2*numx.pi)
+ ctx.arc (x, self.height - y, 0.5, 0, 2*npy.pi)
 self._fill_and_stroke (ctx, gc.get_rgb())
 
 
@@ -294,7 +294,7 @@
 
 ctx.save()
 if angle:
- ctx.rotate (-angle * numx.pi / 180)
+ ctx.rotate (-angle * npy.pi / 180)
 ctx.set_font_size (size)
 ctx.show_text (s)
 ctx.restore()
@@ -304,7 +304,7 @@
 if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())
 # mathtext using the gtk/gdk method
 
- #if numx.which[0] == "numarray":
+ #if npy.which[0] == "numarray":
 # warnings.warn("_draw_mathtext() currently works for numpy, but "
 # "not numarray")
 # return
@@ -327,21 +327,21 @@
 N = imw*imh
 
 # a numpixels by num fonts array
- Xall = numx.zeros((N,len(fonts)), typecode=numx.UInt8)
+ Xall = npy.zeros((N,len(fonts)), npy.uint8)
 
 for i, font in enumerate(fonts):
 if angle == 90:
 font.horiz_image_to_vert_image() # <-- Rotate
 imw, imh, s = font.image_as_str()
- Xall[:,i] = numx.fromstring(s, numx.UInt8)
+ Xall[:,i] = npy.fromstring(s, npy.uint8)
 
 # get the max alpha at each pixel
- Xs = numx.mlab.max (Xall,1)
+ Xs = npy.mlab.max (Xall,1)
 
 # convert it to it's proper shape
 Xs.shape = imh, imw
 
- pa = numx.zeros(shape=(imh,imw,4), typecode=numx.UInt8)
+ pa = npy.zeros((imh,imw,4), npy.uint8)
 rgb = gc.get_rgb()
 pa[:,:,0] = int(rgb[0]*255)
 pa[:,:,1] = int(rgb[1]*255)
@@ -469,7 +469,7 @@
 self.ctx.set_dash([], 0) # switch dashes off
 else:
 self.ctx.set_dash (
- self.renderer.points_to_pixels (numx.asarray(dashes)), offset)
+ self.renderer.points_to_pixels (npy.asarray(dashes)), offset)
 
 
 def set_foreground(self, fg, isRGB=None):
@@ -593,7 +593,7 @@
 ctx = renderer.ctx
 
 if orientation == 'landscape':
- ctx.rotate (numx.pi/2)
+ ctx.rotate (npy.pi/2)
 ctx.translate (0, -height_in_points)
 # cairo/src/cairo_ps_surface.c
 # '%%Orientation: Portrait' is always written to the file header
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gd.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gd.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gd.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -115,8 +115,8 @@
 point in x, y
 """
 
- x = x.astype(nx.Int16)
- y = self.height*ones(y.shape, nx.Int16) - y.astype(nx.Int16)
+ x = x.astype(nx.int16)
+ y = self.height*ones(y.shape, nx.int16) - y.astype(nx.int16)
 style = self._set_gd_style(gc)
 self.im.lines( zip(x,y), style)
 self.flush_clip()
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gdk.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -24,7 +24,7 @@
 from matplotlib.figure import Figure
 from matplotlib.mathtext import math_parse_s_ft2font
 import matplotlib.numerix as numerix
-from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
+from matplotlib.numerix import asarray, fromstring, uint8, zeros, \
 where, transpose, nonzero, indices, ones, nx
 
 
@@ -106,7 +106,7 @@
 im.flipud_out()
 rows, cols, image_str = im.as_rgba_str()
 
- image_array = fromstring(image_str, UInt8)
+ image_array = fromstring(image_str, uint8)
 image_array.shape = rows, cols, 4
 
 pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,
@@ -144,8 +144,8 @@
 
 def draw_lines(self, gc, x, y, transform=None):
 if gc.gdkGC.line_width > 0:
- x = x.astype(nx.Int16)
- y = self.height - y.astype(nx.Int16)
+ x = x.astype(nx.int16)
+ y = self.height - y.astype(nx.int16)
 self.gdkDrawable.draw_lines(gc.gdkGC, zip(x,y))
 
 
@@ -213,13 +213,13 @@
 N = imw*imh
 
 # a numpixels by num fonts array
- Xall = zeros((N,len(fonts)), typecode=UInt8)
+ Xall = zeros((N,len(fonts)), uint8)
 
 for i, font in enumerate(fonts):
 if angle == 90:
 font.horiz_image_to_vert_image() # <-- Rotate
 imw, imh, image_str = font.image_as_str()
- Xall[:,i] = fromstring(image_str, UInt8)
+ Xall[:,i] = fromstring(image_str, uint8)
 
 # get the max alpha at each pixel
 Xs = numerix.mlab.max(Xall,1)
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -22,9 +22,8 @@
 from matplotlib.cbook import is_string_like, enumerate
 from matplotlib.colors import colorConverter
 from matplotlib.figure import Figure
-import matplotlib.numerix as numerix
-from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
- where, transpose, nonzero, indices, ones, nx
+from numpy import asarray, fromstring, zeros, \
+ where, transpose, nonzero, indices, ones
 from matplotlib.widgets import SubplotTool
 
 from matplotlib import lines
@@ -156,7 +155,7 @@
 gdk.LEAVE_NOTIFY_MASK |
 gdk.POINTER_MOTION_MASK |
 gdk.POINTER_MOTION_HINT_MASK)
- 
+
 def __init__(self, figure):
 if _debug: print 'FigureCanvasGTK.%s' % fn_name()
 FigureCanvasBase.__init__(self, figure)
@@ -1087,7 +1086,7 @@
 
 hbox.show_all()
 self.set_extra_widget(hbox)
- 
+
 def get_filename_from_user (self):
 while True:
 filename = None
@@ -1137,7 +1136,7 @@
 
 def __init__(self, lines):
 import gtk.glade
- 
+
 datadir = matplotlib.get_data_path()
 gladefile = os.path.join(datadir, 'lineprops.glade')
 if not os.path.exists(gladefile):
@@ -1279,7 +1278,7 @@
 # Unfortunately, the SVG renderer (rsvg) leaks memory under earlier
 # versions of pygtk, so we have to use a PNG file instead.
 try:
- 
+
 if gtk.pygtk_version < (2, 8, 0):
 icon_filename = 'matplotlib.png'
 else:
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -28,7 +28,7 @@
 from matplotlib.dviread import Dvi
 from matplotlib.ft2font import FT2Font, FIXED_WIDTH, ITALIC, LOAD_NO_SCALE
 from matplotlib.mathtext import math_parse_s_pdf
-from matplotlib.numerix import Float32, UInt8, fromstring, arange, infinity, isnan, asarray
+from numpy import float32, uint8, fromstring, arange, infinity, isnan, asarray
 from matplotlib.transforms import Bbox
 from matplotlib import ttconv
 
@@ -543,13 +543,13 @@
 fontdict['FontMatrix'] = [ .001, 0, 0, .001, 0, 0 ]
 fontdict['CharProcs'] = charprocsObject
 fontdict['Encoding'] = {
- 'Type': Name('Encoding'), 
+ 'Type': Name('Encoding'),
 'Differences': differencesArray}
 elif fonttype == 42:
 fontdict['Subtype'] = Name('TrueType')
 fontdict['Encoding'] = Name('WinAnsiEncoding')
 
- 
+
 flags = 0
 symbolic = False #ps_name.name in ('Cmsy10', 'Cmmi10', 'Cmex10')
 if ff & FIXED_WIDTH: flags |= 1 << 0
@@ -632,7 +632,7 @@
 self.beginStream(charprocObject.id,
 None,
 {'Length': len(stream)})
- self.currentstream.write(stream) 
+ self.currentstream.write(stream)
 self.endStream()
 charprocs[charname] = charprocObject
 self.writeObject(charprocsObject, charprocs)
@@ -755,20 +755,20 @@
 def _rgb(self, im):
 h,w,s = im.as_rgba_str()
 
- rgba = fromstring(s, UInt8)
+ rgba = fromstring(s, uint8)
 rgba.shape = (h, w, 4)
 rgb = rgba[:,:,:3]
 return h, w, rgb.tostring()
 
 def _gray(self, im, rc=0.3, gc=0.59, bc=0.11):
 rgbat = im.as_rgba_str()
- rgba = fromstring(rgbat[2], UInt8)
+ rgba = fromstring(rgbat[2], uint8)
 rgba.shape = (rgbat[0], rgbat[1], 4)
- rgba_f = rgba.astype(Float32)
+ rgba_f = rgba.astype(float32)
 r = rgba_f[:,:,0]
 g = rgba_f[:,:,1]
 b = rgba_f[:,:,2]
- gray = (r*rc + g*gc + b*bc).astype(UInt8)
+ gray = (r*rc + g*gc + b*bc).astype(uint8)
 return rgbat[0], rgbat[1], gray.tostring()
 
 def writeImages(self):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -26,7 +26,7 @@
 
 from matplotlib.transforms import get_vec6_scales
 
-from matplotlib.numerix import UInt8, Float32, alltrue, array, ceil, equal, \
+from matplotlib.numerix import uint8, float32, alltrue, array, ceil, equal, \
 fromstring, nonzero, ones, put, take, where, isnan
 import binascii
 import re
@@ -336,20 +336,20 @@
 def _rgb(self, im):
 h,w,s = im.as_rgba_str()
 
- rgba = fromstring(s, UInt8)
+ rgba = fromstring(s, uint8)
 rgba.shape = (h, w, 4)
 rgb = rgba[:,:,:3]
 return h, w, rgb.tostring()
 
 def _gray(self, im, rc=0.3, gc=0.59, bc=0.11):
 rgbat = im.as_rgba_str()
- rgba = fromstring(rgbat[2], UInt8)
+ rgba = fromstring(rgbat[2], uint8)
 rgba.shape = (rgbat[0], rgbat[1], 4)
- rgba_f = rgba.astype(Float32)
+ rgba_f = rgba.astype(float32)
 r = rgba_f[:,:,0]
 g = rgba_f[:,:,1]
 b = rgba_f[:,:,2]
- gray = (r*rc + g*gc + b*bc).astype(UInt8)
+ gray = (r*rc + g*gc + b*bc).astype(uint8)
 return rgbat[0], rgbat[1], gray.tostring()
 
 def _hex_lines(self, s, chars_per_line=128):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -5,9 +5,8 @@
 
 import matplotlib
 from matplotlib import verbose
-from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
- where, transpose, nonzero, indices, ones, nx
-import matplotlib.numerix as numerix
+from numpy import asarray, fromstring, zeros, \
+ where, transpose, nonzero, indices, ones
 from matplotlib.cbook import is_string_like, enumerate, onetrue
 from matplotlib.font_manager import fontManager
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
@@ -323,7 +322,7 @@
 for text, tooltip_text, image_file, callback in self.toolitems:
 if text is not None:
 qt.QObject.disconnect( self.buttons[ text ],
- qt.SIGNAL( 'clicked()' ), 
+ qt.SIGNAL( 'clicked()' ),
 getattr( self, callback ) )
 
 def pan( self, *args ):
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -5,9 +5,8 @@
 
 import matplotlib
 from matplotlib import verbose
-from matplotlib.numerix import asarray, fromstring, UInt8, zeros, \
- where, transpose, nonzero, indices, ones, nx
-import matplotlib.numerix as numerix
+from numpy import asarray, fromstring, zeros, \
+ where, transpose, nonzero, indices, ones
 from matplotlib.cbook import is_string_like, enumerate, onetrue
 from matplotlib.font_manager import fontManager
 from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
Modified: trunk/matplotlib/lib/matplotlib/colors.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colors.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/colors.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -432,7 +432,7 @@
 mask_bad = ma.getmask(xma)
 if xa.dtype.char in npy.typecodes['Float']:
 npy.putmask(xa, xa==1.0, 0.9999999) #Treat 1.0 as slightly less than 1.
- xa = (xa * self.N).astype(npy.int)
+ xa = (xa * self.N).astype(int)
 # Set the over-range indices before the under-range;
 # otherwise the under-range values get converted to over-range.
 npy.putmask(xa, xa>self.N-1, self._i_over)
Modified: trunk/matplotlib/lib/matplotlib/image.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/image.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/image.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -11,7 +11,7 @@
 import cm
 import numerix
 import numerix.ma as ma
-from numerix import arange, asarray, UInt8, Float32, repeat, NewAxis, typecode
+from numerix import arange, asarray, uint8, float32, repeat, newaxis
 import _image
 
 
@@ -117,7 +117,7 @@
 raise RuntimeError('You must first set the image array or the image attribute')
 
 if self._imcache is None:
- if typecode(self._A) == UInt8 and len(self._A.shape) == 3:
+ if self._A.dtype == uint8 and len(self._A.shape) == 3:
 im = _image.frombyte(self._A, 0)
 im.is_grayscale = False
 else:
@@ -186,7 +186,7 @@
 """Test whether the mouse event occured within the image.
 """
 if callable(self._contains): return self._contains(self,mouseevent)
- # TODO: make sure this is consistent with patch and patch 
+ # TODO: make sure this is consistent with patch and patch
 # collection on nonlinear transformed coordinates.
 # TODO: consider returning image coordinates (shouldn't
 # be too difficult given that the image is rectilinear
@@ -197,7 +197,7 @@
 inside = xdata>=xmin and xdata<=xmax and ydata>=ymin and ydata<=ymax
 else:
 inside = False
- 
+
 return inside,{}
 
 def write_png(self, fname, noscale=False):
@@ -333,8 +333,8 @@
 return im
 
 def set_data(self, x, y, A):
- x = asarray(x).astype(Float32)
- y = asarray(y).astype(Float32)
+ x = asarray(x,float32)
+ y = asarray(y,float32)
 A = asarray(A)
 if len(x.shape) != 1 or len(y.shape) != 1\
 or A.shape[0:2] != (y.shape[0], x.shape[0]):
@@ -346,16 +346,16 @@
 if len(A.shape) == 3 and A.shape[2] == 1:
 A.shape = A.shape[0:2]
 if len(A.shape) == 2:
- if typecode(A) != UInt8:
- A = (self.cmap(self.norm(A))*255).astype(UInt8)
+ if A.dtype != uint8:
+ A = (self.cmap(self.norm(A))*255).astype(uint8)
 else:
- A = repeat(A[:,:,NewAxis], 4, 2)
+ A = repeat(A[:,:,newaxis], 4, 2)
 A[:,:,3] = 255
 else:
- if typecode(A) != UInt8:
- A = (255*A).astype(UInt8)
+ if A.dtype != uint8:
+ A = (255*A).astype(uint8)
 if A.shape[2] == 3:
- B = zeros(tuple(list(A.shape[0:2]) + [4]), UInt8)
+ B = zeros(tuple(list(A.shape[0:2]) + [4]), uint8)
 B[:,:,0:3] = A
 B[:,:,3] = 255
 A = B
@@ -428,7 +428,7 @@
 inside = xdata>=xmin and xdata<=xmax and ydata>=ymin and ydata<=ymax
 else:
 inside = False
- 
+
 return inside,{}
 
 def get_size(self):
@@ -441,7 +441,7 @@
 def get_extent(self):
 'get the image extent: left, right, bottom, top'
 numrows, numcols = self.get_size()
- return (-0.5+self.ox, numcols-0.5+self.ox, 
+ return (-0.5+self.ox, numcols-0.5+self.ox,
 -0.5+self.oy, numrows-0.5+self.oy)
 
 def make_image(self, magnification=1.0):
@@ -504,6 +504,6 @@
 raise RuntimeError('Unknown image mode')
 
 x_str = im.tostring('raw',im.mode,0,-1)
- x = numerix.fromstring(x_str,numerix.UInt8)
+ x = numerix.fromstring(x_str,numerix.uint8)
 x.shape = im.size[1], im.size[0], 4
 return x
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/legend.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -22,7 +22,7 @@
 """
 from __future__ import division
 import sys, warnings
-from numerix import array, ones, Float
+from numerix import array, ones
 
 
 from matplotlib import verbose, rcParams
@@ -280,7 +280,7 @@
 x, y = label.get_position()
 x -= self.handlelen + self.handletextsep
 if isinstance(handle, Line2D):
- ydata = (y-HEIGHT/2)*ones(self._xdata.shape, Float)
+ ydata = (y-HEIGHT/2)*ones(self._xdata.shape, float)
 legline = Line2D(self._xdata, ydata)
 legline.update_from(handle)
 self._set_artist_props(legline) # after update
@@ -298,7 +298,7 @@
 p.set_clip_box(None)
 ret.append(p)
 elif isinstance(handle, LineCollection):
- ydata = (y-HEIGHT/2)*ones(self._xdata.shape, Float)
+ ydata = (y-HEIGHT/2)*ones(self._xdata.shape, float)
 legline = Line2D(self._xdata, ydata)
 self._set_artist_props(legline)
 legline.set_clip_box(None)
@@ -555,7 +555,7 @@
 for handle, tup in zip(self.legendHandles, hpos):
 y,h = tup
 if isinstance(handle, Line2D):
- ydata = y*ones(self._xdata.shape, Float)
+ ydata = y*ones(self._xdata.shape, float)
 handle.set_ydata(ydata+h/2)
 elif isinstance(handle, Rectangle):
 handle.set_y(y+1/4*h)
Modified: trunk/matplotlib/lib/matplotlib/lines.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/lines.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/lines.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -9,10 +9,10 @@
 import sys, math, warnings
 
 import agg
-from numerix import Float, alltrue, arange, array, logical_and, \
+from numerix import alltrue, arange, array, logical_and, \
 nonzero, searchsorted, take, asarray, ones, where, less, ravel, \
 greater, cos, sin, pi, sqrt, less_equal, \
- compress, zeros, concatenate, cumsum, typecode, NewAxis
+ compress, zeros, concatenate, cumsum, newaxis
 import numerix.ma as ma
 from matplotlib import verbose
 import artist
@@ -64,12 +64,12 @@
 if len(i1) == 0:
 return None
 if not compressed:
- return concatenate((i0[:, NewAxis], i1[:, NewAxis]), axis=1)
+ return concatenate((i0[:, newaxis], i1[:, newaxis]), axis=1)
 seglengths = i1 - i0
 breakpoints = cumsum(seglengths)
 ic0 = concatenate(((0,), breakpoints[:-1]))
 ic1 = breakpoints
- return concatenate((ic0[:, NewAxis], ic1[:, NewAxis]), axis=1)
+ return concatenate((ic0[:, newaxis], ic1[:, newaxis]), axis=1)
 
 def segment_hits(cx,cy,x,y,radius):
 """Determine if any line segments are within radius of a point. Returns
@@ -88,7 +88,7 @@
 u = ( (cx-xr)*dx + (cy-yr)*dy )/Lnorm_sq
 candidates = (u>=0) & (u<=1)
 #if any(candidates): print "candidates",xr[candidates]
- 
+
 # Note that there is a little area near one side of each point
 # which will be near neither segment, and another which will
 # be near both, depending on the angle of the lines. The
@@ -96,7 +96,7 @@
 point_hits = (cx - x)**2 + (cy - y)**2 <= radius**2
 #if any(point_hits): print "points",xr[candidates]
 candidates = candidates & ~point_hits[:-1] & ~point_hits[1:]
- 
+
 # For those candidates which remain, determine how far they lie away
 # from the line.
 px,py = xr+u*dx,yr+u*dy
@@ -164,7 +164,7 @@
 else:
 return "Line2D(%s)"\
 %(",".join(["(%g,%g)"%(x,y) for x,y in zip(self._x,self._y)]))
- 
+
 def __init__(self, xdata, ydata,
 linewidth = None, # all Nones default to rc
 linestyle = None,
@@ -274,25 +274,25 @@
 
 self.set_data(xdata, ydata)
 self._logcache = None
- 
+
 # TODO: do we really need 'newstyle'
 self._newstyle = False
 
 def contains(self, mouseevent):
 """Test whether the mouse event occurred on the line. The pick radius determines
 the precision of the location test (usually within five points of the value). Use
- get/set pickradius() to view or modify it. 
- 
- Returns True if any values are within the radius along with {'ind': pointlist}, 
+ get/set pickradius() to view or modify it.
+
+ Returns True if any values are within the radius along with {'ind': pointlist},
 where pointlist is the set of points within the radius.
- 
+
 TODO: sort returned indices by distance
 """
 if callable(self._contains): return self._contains(self,mouseevent)
- 
+
 if not is_numlike(self.pickradius):
 raise ValueError,"pick radius should be a distance"
- 
+
 if self._newstyle:
 # transform in backend
 x = self._x
@@ -308,7 +308,7 @@
 pixels = self.pickradius
 else:
 pixels = self.figure.dpi.get()/72. * self.pickradius
- 
+
 if self._linestyle == 'None':
 # If no line, return the nearby point(s)
 d = sqrt((xt-mouseevent.x)**2 + (yt-mouseevent.y)**2)
@@ -322,21 +322,21 @@
 print 'd', (xt-mouseevent.x)**2., (yt-mouseevent.y)**2.
 print d, pixels, ind
 return len(ind)>0,dict(ind=ind)
- 
+
 def get_pickradius(self):
 'return the pick radius used for containment tests'
 return self.pickradius
 
- def set_pickradius(self,d): 
+ def set_pickradius(self,d):
 """Sets the pick radius used for containment tests
- 
+
 Accepts: float distance in points.
 """
 self.pickradius = d
- 
+
 def set_picker(self,p):
 """Sets the event picker details for the line.
- 
+
 Accepts: float distance in points or callable pick function fn(artist,event)
 """
 if callable(p):
@@ -344,7 +344,7 @@
 else:
 self.pickradius = p
 self._picker = p
- 
+
 def get_window_extent(self, renderer):
 self._newstyle = hasattr(renderer, 'draw_markers')
 if self._newstyle:
@@ -398,15 +398,15 @@
 def recache(self):
 #if self.axes is None: print 'recache no axes'
 #else: print 'recache units', self.axes.xaxis.units, self.axes.yaxis.units
- x = ma.asarray(self.convert_xunits(self._xorig), Float)
- y = ma.asarray(self.convert_yunits(self._yorig), Float)
+ x = ma.asarray(self.convert_xunits(self._xorig), float)
+ y = ma.asarray(self.convert_yunits(self._yorig), float)
 
 x = ma.ravel(x)
 y = ma.ravel(y)
 if len(x)==1 and len(y)>1:
- x = x * ones(y.shape, Float)
+ x = x * ones(y.shape, float)
 if len(y)==1 and len(x)>1:
- y = y * ones(x.shape, Float)
+ y = y * ones(x.shape, float)
 
 if len(x) != len(y):
 raise RuntimeError('xdata and ydata must be the same length')
@@ -421,8 +421,8 @@
 else:
 self._segments = None
 
- self._x = asarray(x, Float)
- self._y = asarray(y, Float)
+ self._x = asarray(x, float)
+ self._y = asarray(y, float)
 
 self._logcache = None
 
@@ -557,7 +557,7 @@
 else:
 return self._markerfacecolor
 
- 
+
 def get_markersize(self): return self._markersize
 
 def get_xdata(self, orig=True):
@@ -708,9 +708,9 @@
 def _draw_steps(self, renderer, gc, xt, yt):
 siz=len(xt)
 if siz<2: return
- xt2=ones((2*siz,), typecode(xt))
+ xt2=ones((2*siz,), xt.dtype)
 xt2[0:-1:2], xt2[1:-1:2], xt2[-1]=xt, xt[1:], xt[-1]
- yt2=ones((2*siz,), typecode(yt))
+ yt2=ones((2*siz,), yt.dtype)
 yt2[0:-1:2], yt2[1::2]=yt, yt
 gc.set_linestyle('solid')
 
Modified: trunk/matplotlib/lib/matplotlib/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mlab.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/mlab.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -71,7 +71,7 @@
 multiply, transpose, ravel, repeat, resize, reshape, floor, ceil,\
 absolute, matrixmultiply, power, take, where, Float, Int, asum,\
 dot, convolve, pi, Complex, ones, zeros, diagonal, Matrix, nonzero, \
- log, searchsorted, concatenate, sort, ArrayType, clip, size, indices,\
+ log, searchsorted, concatenate, sort, ArrayType, ndarray, clip, size, indices,\
 conjugate, typecode, iscontiguous
 
 
@@ -184,7 +184,7 @@
 
 
 # for real x, ignore the negative frequencies
- if typecode(x)==Complex: numFreqs = NFFT
+ if npy.iscomplexobj(x): numFreqs = NFFT
 else: numFreqs = NFFT//2+1
 
 if iterable(window):
@@ -195,7 +195,7 @@
 step = NFFT-noverlap
 ind = range(0,len(x)-NFFT+1,step)
 n = len(ind)
- Pxx = zeros((numFreqs,n), Float)
+ Pxx = zeros((numFreqs,n), float)
 # do the ffts of the slices
 for i in range(n):
 thisX = x[ind[i]:ind[i]+NFFT]
@@ -243,7 +243,7 @@
 
 if NFFT % 2:
 raise ValueError, 'NFFT must be a power of 2'
- 
+
 x = asarray(x) # make sure we're dealing with a numpy array
 y = asarray(y) # make sure we're dealing with a numpy array
 
@@ -258,7 +258,7 @@
 y[n:] = 0
 
 # for real x, ignore the negative frequencies
- if typecode(x)==Complex: numFreqs = NFFT
+ if npy.iscomplexobj(x): numFreqs = NFFT
 else: numFreqs = NFFT//2+1
 
 if iterable(window):
@@ -269,7 +269,7 @@
 step = NFFT-noverlap
 ind = range(0,len(x)-NFFT+1,step)
 n = len(ind)
- Pxy = zeros((numFreqs,n), Complex)
+ Pxy = zeros((numFreqs,n), complex)
 
 # do the ffts of the slices
 for i in range(n):
@@ -542,7 +542,7 @@
 del seen
 
 # for real X, ignore the negative frequencies
- if typecode(X)==Complex: numFreqs = NFFT
+ if npy.iscomplexobj(X): numFreqs = NFFT
 else: numFreqs = NFFT//2+1
 
 # cache the FFT of every windowed, detrended NFFT length segement
@@ -562,7 +562,7 @@
 normVal = norm(windowVals)**2
 for iCol in allColumns:
 progressCallback(i/Ncols, 'Cacheing FFTs')
- Slices = zeros( (numSlices,numFreqs), Complex)
+ Slices = zeros( (numSlices,numFreqs), complex)
 for iSlice in slices:
 thisSlice = X[ind[iSlice]:ind[iSlice]+NFFT, iCol]
 thisSlice = windowVals*detrend(thisSlice)
@@ -618,7 +618,7 @@
 
 
 n,bins = hist(y, bins)
- n = n.astype(Float)
+ n = n.astype(float)
 
 n = take(n, nonzero(n)) # get the positive
 
@@ -691,14 +691,14 @@
 dx = x[1]-x[0]
 
 
- f = 1/(N*dx)*arange(-N/2, N/2, Float)
+ f = 1/(N*dx)*arange(-N/2, N/2, float)
 
- ind = concatenate([arange(N/2, N, Int),
- arange(N/2,Int)])
+ ind = concatenate([arange(N/2, N, int),
+ arange(0, N/2, int)])
 df = f[1]-f[0]
 cfl = exp(-gamma*absolute(2*pi*f)**alpha)
 
- px = fft(take(cfl,ind)*df).astype(Float)
+ px = fft(take(cfl,ind)*df).astype(float)
 return take(px, ind)
 
 
@@ -758,7 +758,7 @@
 if len(ind)==0: return arange(len(x))
 if len(ind)==len(x): return array([])
 
- y = zeros( (len(x)+2,), Int)
+ y = zeros( (len(x)+2,), int)
 y[1:-1] = x
 d = diff(y)
 #print 'd', d
@@ -811,7 +811,7 @@
 return x[int(p*Nx/100.0)]
 
 p = multiply(array(p), Nx/100.0)
- ind = p.astype(Int)
+ ind = p.astype(int)
 ind = where(ind>=Nx, Nx-1, ind)
 return take(x, ind)
 
@@ -846,7 +846,7 @@
 # todo: implement this w/o loop. Allow optional arg to specify
 # dimension to remove the mean from
 if dim==1: M = transpose(M)
- M = array(M, Float)
+ M = array(M, float)
 if len(M.shape)==1 or M.shape[0]==1 or M.shape[1]==1:
 M = M-mean(M)
 sigma = std(M)
@@ -938,9 +938,9 @@
 
 try: Ny = len(y0)
 except TypeError:
- yout = zeros( (len(t),), Float)
+ yout = zeros( (len(t),), float)
 else:
- yout = zeros( (len(t), Ny), Float)
+ yout = zeros( (len(t), Ny), float)
 
 
 yout[0] = y0
@@ -997,7 +997,7 @@
 
 
 # for real x, ignore the negative frequencies
- if typecode(x)==Complex: numFreqs=NFFT
+ if npy.iscomplexobj(x): numFreqs=NFFT
 else: numFreqs = NFFT//2+1
 
 if iterable(window):
@@ -1008,7 +1008,7 @@
 step = NFFT-noverlap
 ind = arange(0,len(x)-NFFT+1,step)
 n = len(ind)
- Pxx = zeros((numFreqs,n), Float)
+ Pxx = zeros((numFreqs,n), float)
 # do the ffts of the slices
 
 for i in range(n):
@@ -1021,7 +1021,7 @@
 t = 1/Fs*(ind+NFFT/2)
 freqs = Fs/NFFT*arange(numFreqs)
 
- if typecode(x) == Complex:
+ if npy.iscomplexobj(x):
 freqs = concatenate((freqs[NFFT/2:]-Fs,freqs[:NFFT/2]))
 Pxx = concatenate((Pxx[NFFT/2:,:],Pxx[:NFFT/2,:]),0)
 
@@ -1092,9 +1092,9 @@
 This algorithm from
 http://softsurfer.com/Archive/algorithm_0102/algorithm_0102.htm#Distance%20to%20Ray%20or%20Segment
 """
- p = asarray(p, Float)
- s0 = asarray(s0, Float)
- s1 = asarray(s1, Float)
+ p = asarray(p, float)
+ s0 = asarray(s0, float)
+ s1 = asarray(s1, float)
 v = s1 - s0
 w = p - s0
 
@@ -1178,10 +1178,10 @@
 """
 def __init__(self, nmax):
 'buffer up to nmax points'
- self._xa = nx.zeros((nmax,), typecode=nx.Float)
- self._ya = nx.zeros((nmax,), typecode=nx.Float)
- self._xs = nx.zeros((nmax,), typecode=nx.Float)
- self._ys = nx.zeros((nmax,), typecode=nx.Float)
+ self._xa = nx.zeros((nmax,), typecode=float)
+ self._ya = nx.zeros((nmax,), typecode=float)
+ self._xs = nx.zeros((nmax,), typecode=float)
+ self._ys = nx.zeros((nmax,), typecode=float)
 self._ind = 0
 self._nmax = nmax
 self.dataLim = None
@@ -1242,7 +1242,7 @@
 n = int(n)
 N = len(x)
 assert(N>n)
- y = zeros(N-(n-1),Float)
+ y = zeros(N-(n-1),float)
 for i in range(n):
 y += x[i:N-(n-1)+i]
 y /= float(n)
@@ -1363,7 +1363,7 @@
 thisLen = len(row)
 X.append(row)
 
- X = array(X, nx.Float)
+ X = array(X, float)
 r,c = X.shape
 if r==1 or c==1:
 X.shape = max([r,c]),
@@ -1397,15 +1397,15 @@
 converterd, if not None, is a dictionary mapping column number or
 munged column name to a converter function
 
- 
+
 See examples/loadrec.py
 """
 
 
- 
+
 if converterd is None:
 converterd = dict()
- 
+
 import dateutil.parser
 parsedate = dateutil.parser.parse
 
@@ -1423,8 +1423,8 @@
 process_skiprows(reader)
 
 
- 
 
+
 def get_func(item, func):
 # promote functions in this order
 funcmap = {int:float, float:dateutil.parser.parse, dateutil.parser.parse:str}
@@ -1434,7 +1434,7 @@
 raise ValueError('Could not find a working conversion function')
 else: return get_func(item, funcmap[func]) # recurse
 else: return func
- 
+
 def get_converters(reader):
 
 converters = None
@@ -1534,10 +1534,10 @@
 Icelandic Meteorological Office, March 2006 halldor at vedur.is)
 """
 # Cast key variables as float.
- x=nx.asarray(x, nx.Float)
- y=nx.asarray(y, nx.Float)
+ x=nx.asarray(x, float)
+ y=nx.asarray(y, float)
 
- yp=nx.zeros(y.shape, nx.Float)
+ yp=nx.zeros(y.shape, float)
 
 dx=x[1:] - x[:-1]
 dy=y[1:] - y[:-1]
@@ -1592,18 +1592,18 @@
 """
 
 # Cast key variables as float.
- x=nx.asarray(x, nx.Float)
- y=nx.asarray(y, nx.Float)
+ x=nx.asarray(x, float)
+ y=nx.asarray(y, float)
 assert x.shape == y.shape
 N=len(y)
 
 if yp is None:
 yp = slopes(x,y)
 else:
- yp=nx.asarray(yp, nx.Float)
+ yp=nx.asarray(yp, float)
 
- xi=nx.asarray(xi, nx.Float)
- yi=nx.zeros(xi.shape, nx.Float)
+ xi=nx.asarray(xi, float)
+ yi=nx.zeros(xi.shape, float)
 
 # calculate linear slopes
 dx = x[1:] - x[:-1]
@@ -1633,7 +1633,7 @@
 # does more calculations than necessary but exploiting the power
 # of numpy, this is far more efficient than coding a loop by hand
 # in Python
- yi = yo + dy1dy2 * nx.choose(nx.array(nx.sign(dy1dy2), nx.Int32)+1,
+ yi = yo + dy1dy2 * nx.choose(nx.array(nx.sign(dy1dy2), nx.int32)+1,
 ((2*xi-xidx-xidxp1)/((dy1-dy2)*(xidxp1-xidx)),
 0.0,
 1/(dy1+dy2),))
@@ -1662,11 +1662,11 @@
 d = nx.where(nx.less(d, 0), twopi + d, d)
 return nx.where(nx.greater(d,nx.pi), d-twopi, d)
 
- angles = nx.zeros((Nxy,), nx.Float)
- x1 = nx.zeros((Nxy,), nx.Float)
- y1 = nx.zeros((Nxy,), nx.Float)
- x2 = nx.zeros((Nxy,), nx.Float)
- y2 = nx.zeros((Nxy,), nx.Float)
+ angles = nx.zeros((Nxy,), float)
+ x1 = nx.zeros((Nxy,), float)
+ y1 = nx.zeros((Nxy,), float)
+ x2 = nx.zeros((Nxy,), float)
+ y2 = nx.zeros((Nxy,), float)
 x = xys[:,0]
 y = xys[:,1]
 for i in range(Nv):
@@ -1726,7 +1726,7 @@
 Nx = len(x)
 if not iterable(ylower):
 ylower = ylower*npy.ones(Nx)
- 
+
 if not iterable(yupper):
 yupper = yupper*npy.ones(Nx)
 
@@ -1796,7 +1796,7 @@
 floating point exception handling with access to the underlying
 hardware."""
 
- if type(x) is ArrayType:
+ if type(x) is ndarray:
 return exp(clip(x,exp_safe_MIN,exp_safe_MAX))
 else:
 return math.exp(x)
Modified: trunk/matplotlib/lib/matplotlib/numerix/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/__init__.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/numerix/__init__.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -22,16 +22,18 @@
 
 #########################
 
+# the following is exclusively used and/or reexported by pylab.py and mlab.py:
+
 asum = sum
 matrixmultiply = dot
 
-#from numpy.oldnumeric import *
 from numpy.oldnumeric import \
- ArrayType, cross_correlate, NewAxis, \
- arrayrange, innerproduct, outerproduct
+ ArrayType, \
+ cross_correlate, \
+ arrayrange, \
+ innerproduct, \
+ outerproduct
 
-newaxis = NewAxis
-
 from numpy.oldnumeric import Int8, UInt8, \
 Int16, UInt16, \
 Int32, UInt32, \
@@ -48,7 +50,3 @@
 return a.dtype.char
 def iscontiguous(a):
 return a.flags.contiguous
-def byteswapped(a):
- return a.byteswap()
-def itemsize(a):
- return a.itemsize
Modified: trunk/matplotlib/lib/matplotlib/patches.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/patches.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/patches.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -46,7 +46,7 @@
 zorder = 1
 def __str__(self):
 return str(self.__class__).split('.')[-1]
- 
+
 def __init__(self,
 edgecolor=None,
 facecolor=None,
@@ -78,12 +78,12 @@
 __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
 
 def contains(self, mouseevent):
- """Test whether the mouse event occurred in the patch. 
- 
+ """Test whether the mouse event occurred in the patch.
+
 Returns T/F, {}
 """
 if callable(self._contains): return self._contains(self,mouseevent)
- 
+
 try:
 # TODO: make this consistent with patch collection algorithm
 x, y = self.get_transform().inverse_xy_tup((mouseevent.x, mouseevent.y))
@@ -268,7 +268,7 @@
 class Shadow(Patch):
 def __str__(self):
 return "Shadow(%s)"%(str(self.patch))
- 
+
 def __init__(self, patch, ox, oy, props=None, **kwargs):
 """
 Create a shadow of the patch offset by ox, oy. props, if not None is
@@ -321,7 +321,7 @@
 def __str__(self):
 return str(self.__class__).split('.')[-1] \
 + "(%g,%g;%gx%g)"%(self.xy[0],self.xy[1],self.width,self.height)
- 
+
 def __init__(self, xy, width, height,
 **kwargs):
 """
@@ -424,7 +424,7 @@
 """
 def __str__(self):
 return "Poly%d(%g,%g)"%(self.numVertices,self.xy[0],self.xy[1])
- 
+
 def __init__(self, xy, numVertices, radius=5, orientation=0,
 **kwargs):
 """
@@ -470,7 +470,7 @@
 """
 def __str__(self):
 return "Poly(%g,%g)"%self.xy[0]
- 
+
 def __init__(self, xy, **kwargs):
 """
 xy is a sequence of (x,y) 2 tuples
@@ -529,7 +529,7 @@
 x2,y2 = self.xy[1]
 cx,cy = (x1+x2)/2.,(y1+y2)/2.
 return "Arrow(%g,%g)"%(cx,cy)
- 
+
 def __init__( self, x, y, dx, dy, width=1.0, **kwargs ):
 """Draws an arrow, starting at (x,y), direction and length
 given by (dx,dy) the width of the arrow is scaled by width
@@ -548,7 +548,7 @@
 cx = float(dx)/L
 sx = float(dy)/L
 M = npy.array( [ [ cx, sx],[ -sx, cx ] ] )
- verts = npy.matrixmultiply( arrow, M )+ [x,y]
+ verts = npy.dot( arrow, M )+ [x,y]
 Polygon.__init__( self, [ tuple(t) for t in verts ], **kwargs )
 __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
 
@@ -560,7 +560,7 @@
 x2,y2 = self.xy[1]
 cx,cy = (x1+x2)/2.,(y1+y2)/2.
 return "FancyArrow(%g,%g)"%(cx,cy)
- 
+
 def __init__(self, x, y, dx, dy, width=0.001, length_includes_head=False, \
 head_width=None, head_length=None, shape='full', overhang=0, \
 head_starts_at_zero=False,**kwargs):
@@ -622,7 +622,7 @@
 cx = float(dx)/distance
 sx = float(dy)/distance
 M = npy.array([[cx, sx],[-sx,cx]])
- verts = npy.matrixmultiply(coords, M) + (x+dx, y+dy)
+ verts = npy.dot(coords, M) + (x+dx, y+dy)
 
 Polygon.__init__(self, map(tuple, verts), **kwargs)
 __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd
@@ -639,7 +639,7 @@
 x2,y2 = self.xy[1]
 cx,cy = (x1+x2)/2.,(y1+y2)/2.
 return "YAArrow(%g,%g)"%(cx,cy)
- 
+
 def __init__(self, dpi, xytip, xybase, width=4, frac=0.1, headwidth=12, **kwargs):
 """
 xytip : (x,y) location of arrow tip
@@ -768,7 +768,7 @@
 self.center = xy
 self.width, self.height = width, height
 self.angle = angle
- 
+
 def contains(self,ev):
 if ev.xdata is None or ev.ydata is None: return False,{}
 inside = inellipse(ev.xdata,ev.ydata,
Modified: trunk/matplotlib/lib/matplotlib/proj3d.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/proj3d.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/proj3d.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -146,7 +146,7 @@
 [0, 0, 0, 1]]
 ## end old
 
- return nx.matrixmultiply(Mr,Mt)
+ return nx.dot(Mr,Mt)
 
 def persp_transformation(zfront,zback):
 a = (zfront+zback)/(zfront-zback)
@@ -158,14 +158,14 @@
 ])
 
 def proj_transform_vec(vec, M):
- vecw = nx.matrixmultiply(M,vec)
+ vecw = nx.dot(M,vec)
 w = vecw[3]
 # clip here..
 txs,tys,tzs = vecw[0]/w,vecw[1]/w,vecw[2]/w
 return txs,tys,tzs
 
 def proj_transform_vec_clip(vec, M):
- vecw = nx.matrixmultiply(M,vec)
+ vecw = nx.dot(M,vec)
 w = vecw[3]
 # clip here..
 txs,tys,tzs = vecw[0]/w,vecw[1]/w,vecw[2]/w
@@ -177,7 +177,7 @@
 def inv_transform(xs,ys,zs,M):
 iM = linear_algebra.inverse(M)
 vec = vec_pad_ones(xs,ys,zs)
- vecr = nx.matrixmultiply(iM,vec)
+ vecr = nx.dot(iM,vec)
 try:
 vecr = vecr/vecr[3]
 except OverflowError:
@@ -242,7 +242,7 @@
 V = nx.array([0,0,1])
 viewM = view_transformation(E,R,V)
 perspM = persp_transformation(100,-100)
- M = nx.matrixmultiply(perspM,viewM)
+ M = nx.dot(perspM,viewM)
 return M
 
 def test_proj():
@@ -274,7 +274,7 @@
 [0,sina,cosa,0],
 [0,0,0,0]])
 #
- return nx.matrixmultiply(M1,V)
+ return nx.dot(M1,V)
 
 def test_rot():
 V = [1,0,0,1]
Modified: trunk/matplotlib/lib/matplotlib/table.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/table.py	2007年07月19日 15:26:27 UTC (rev 3574)
+++ trunk/matplotlib/lib/matplotlib/table.py	2007年07月19日 16:53:36 UTC (rev 3575)
@@ -22,7 +22,7 @@
 from __future__ import division
 import sys, warnings
 from matplotlib import verbose
-from numerix import ones, Float, add, asarray
+from numpy import ones, add, asarray
 
 import artist
 from artist import Artist
@@ -248,10 +248,10 @@
 
 bbox = bbox_all(boxes)
 return inverse_transform_bbox(self.get_transform(), bbox)
- 
+
 def contains(self,mouseevent):
- """Test whether the mouse event occurred in the table. 
- 
+ """Test whether the mouse event occurred in the table.
+
 Returns T/F, {}
 """
 if callable(self._contains): return self._contains(self,mouseevent)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <nn...@us...> - 2007年07月19日 15:26:28
Revision: 3574
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3574&view=rev
Author: nnemec
Date: 2007年07月19日 08:26:27 -0700 (2007年7月19日)
Log Message:
-----------
minimized remaining numerix wrapper code
Modified Paths:
--------------
 trunk/matplotlib/CHANGELOG
 trunk/matplotlib/lib/matplotlib/numerix/__init__.py
 trunk/matplotlib/setup.py
Added Paths:
-----------
 trunk/matplotlib/lib/matplotlib/numerix/fft.py
 trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py
 trunk/matplotlib/lib/matplotlib/numerix/ma.py
 trunk/matplotlib/lib/matplotlib/numerix/mlab.py
 trunk/matplotlib/lib/matplotlib/numerix/npyma.py
 trunk/matplotlib/lib/matplotlib/numerix/random_array.py
Removed Paths:
-------------
 trunk/matplotlib/NUMARRAY_ISSUES
 trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py
 trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py
 trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py
 trunk/matplotlib/lib/matplotlib/numerix/fft/
 trunk/matplotlib/lib/matplotlib/numerix/linear_algebra/
 trunk/matplotlib/lib/matplotlib/numerix/ma/
 trunk/matplotlib/lib/matplotlib/numerix/mlab/
 trunk/matplotlib/lib/matplotlib/numerix/npyma/
 trunk/matplotlib/lib/matplotlib/numerix/random_array/
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/CHANGELOG	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -1,3 +1,7 @@
+2007年07月19日 replaced the Python code in numerix/ by a minimal wrapper around
+ numpy that explicitly mentions all symbols that need to be
+	 addressed for further numpification - NN
+
 2007年07月18日 make usetex respect changes to rcParams. texmanager used to 
 only configure itself when it was created, now it 
 reconfigures when rcParams are changed. Thank you Alexander 
Deleted: trunk/matplotlib/NUMARRAY_ISSUES
===================================================================
--- trunk/matplotlib/NUMARRAY_ISSUES	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/NUMARRAY_ISSUES	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -1,27 +0,0 @@
-Todd Miller has added a matplotlib.numerix module to allow matplotlib
-to choose between Numeric or numarry. See the header of that file for
-information on how to choose between Numeric or Numarray from the
-command line or using environment variables. 
-
-For the most part this is seamless and should provide any problems.
-Below is a status report of known issues
-
-* divide array by float - Many of the matplotlib examples do things
- like exp(-t/2.0) where t is an array. If you have 'from __future__
- import division (as matplotlib.matlab does) then you will get an
- error along the lines of 
-
- TypeError: unsupported operand type(s) for /: 'NumArray' and 'float'"
-
- Solution: use numarray 0.9 or later; for older versions, use
- divide(-t, 2.0)
-
-* stock demo does not run with "TypeError: unsubscriptable object"
-
- Solution: array resize/reshape bug fixed in numarray CVS
-
-* Use of convolve in csd demo fails with "ValueError: Invalid
- convolution mode"
-
- Solution: fixed in numarray CVS 
- 
Modified: trunk/matplotlib/lib/matplotlib/numerix/__init__.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/__init__.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/__init__.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -1,171 +1,54 @@
-"""
-numerix imports either Numeric or numarray based on various selectors.
+import sys
 
-0. If the value "--numpy","--numarray" or "--Numeric" is specified on the
- command line, then numerix imports the specified
- array package.
-
-1. The value of numerix in matplotlibrc: either Numeric or numarray
-
-2. If none of the above is done, the default array package is Numeric.
- Because the matplotlibrc always provides *some* value for numerix
- (it has it's own system of default values), this default is most
- likely never used.
-
-To summarize: the commandline is examined first, the rc file second,
-and the default array package is Numeric.
-"""
-
-import sys, os, struct
-from matplotlib import rcParams, verbose
-
-which = None, None
 use_maskedarray = None
 
-# First, see if --numarray or --Numeric was specified on the command
-# line:
-
 for a in sys.argv:
- if a in ["--Numeric", "--numeric", "--NUMERIC",
- "--Numarray", "--numarray", "--NUMARRAY",
- "--NumPy", "--numpy", "--NUMPY", "--Numpy",
- ]:
- which = a[2:], "command line"
 if a == "--maskedarray":
 use_maskedarray = True
 if a == "--ma":
 use_maskedarray = False
 del a
 
-if which[0] is None:
- try: # In theory, rcParams always has *some* value for numerix.
- which = rcParams['numerix'], "rc"
- except KeyError:
- pass
-
 if use_maskedarray is None:
+ import matplotlib
 try:
- use_maskedarray = rcParams['maskedarray']
+ use_maskedarray = matplotlib.rcParams['maskedarray']
 except KeyError:
 use_maskedarray = False
 
-# If all the above fail, default to Numeric. Most likely not used.
-if which[0] is None:
- which = "numeric", "defaulted"
+#########################
 
-which = which[0].strip().lower(), which[1]
-if which[0] not in ["numeric", "numarray", "numpy"]:
- raise ValueError("numerix selector must be either 'Numeric', 'numarray', or 'numpy' but the value obtained from the %s was '%s'." % (which[1], which[0]))
+from numpy import *
 
-if which[0] == "numarray":
- import warnings
- warnings.warn("numarray use as a numerix backed for matplotlib is deprecated",
- DeprecationWarning, stacklevel=1)
+#########################
 
- #from na_imports import *
- from numarray import *
- from _na_imports import nx, inf, infinity, Infinity, Matrix, isnan, all
- from numarray.numeric import nonzero
- from numarray.convolve import cross_correlate, convolve
- import numarray
- version = 'numarray %s'%numarray.__version__
- nan = struct.unpack('d', struct.pack('Q', 0x7ff8000000000000))[0]
+asum = sum
+matrixmultiply = dot
 
-elif which[0] == "numeric":
- import warnings
- warnings.warn("Numeric use as a numerix backed for matplotlib is deprecated",
- DeprecationWarning, stacklevel=1)
+#from numpy.oldnumeric import *
+from numpy.oldnumeric import \
+ ArrayType, cross_correlate, NewAxis, \
+ arrayrange, innerproduct, outerproduct
 
- #from nc_imports import *
- from Numeric import *
- from _nc_imports import nx, inf, infinity, Infinity, isnan, all, any
- from Matrix import Matrix
- import Numeric
- version = 'Numeric %s'%Numeric.__version__
- nan = struct.unpack('d', struct.pack('Q', 0x7ff8000000000000))[0]
+newaxis = NewAxis
 
-elif which[0] == "numpy":
- try:
- import numpy.oldnumeric as numpy
- from numpy.oldnumeric import *
- except ImportError:
- import numpy
- from numpy import *
- print 'except asarray', asarray
- from _sp_imports import nx, infinity, rand, randn, isnan, all, any
- from _sp_imports import UInt8, UInt16, UInt32, Infinity
- try:
- from numpy.oldnumeric.matrix import Matrix
- except ImportError:
- Matrix = matrix
- version = 'numpy %s' % numpy.__version__
- from numpy import nan
-else:
- raise RuntimeError("invalid numerix selector")
+from numpy.oldnumeric import Int8, UInt8, \
+ Int16, UInt16, \
+ Int32, UInt32, \
+ Float32, Float64, \
+ Complex32, Complex64, \
+ Float, Int, Complex
 
+from numpy.oldnumeric.matrix import Matrix
 
-# Some changes are only applicable to the new numpy:
-if (which[0] == 'numarray' or
- which[0] == 'numeric'):
- from mlab import amin, amax
- newaxis = NewAxis
- def typecode(a):
- return a.typecode()
- def iscontiguous(a):
- return a.iscontiguous()
- def byteswapped(a):
- return a.byteswapped()
- def itemsize(a):
- return a.itemsize()
- def angle(a):
- return arctan2(a.imag, a.real)
+from numpy.oldnumeric.mlab import min as amin
+from numpy.oldnumeric.mlab import max as amax
 
-else:
- # We've already checked for a valid numerix selector,
- # so assume numpy.
- from mlab import amin, amax
- newaxis = NewAxis
- from numpy import angle
- def typecode(a):
- return a.dtype.char
- def iscontiguous(a):
- return a.flags.contiguous
- def byteswapped(a):
- return a.byteswap()
- def itemsize(a):
- return a.itemsize
-
-verbose.report('numerix %s'%version)
-# a bug fix for blas numeric suggested by Fernando Perez
-matrixmultiply=dot
-asum = sum
-
-
-def _import_fail_message(module, version):
- """Prints a message when the array package specific version of an extension
- fails to import correctly.
- """
- _dict = { "which" : which[0],
- "module" : module,
- "specific" : version + module
- }
- print """
-The import of the %(which)s version of the %(module)s module,
-%(specific)s, failed. This is is either because %(which)s was
-unavailable when matplotlib was compiled, because a dependency of
-%(specific)s could not be satisfied, or because the build flag for
-this module was turned off in setup.py. If it appears that
-%(specific)s was not built, make sure you have a working copy of
-%(which)s and then re-install matplotlib. Otherwise, the following
-traceback gives more details:\n""" % _dict
-
-g = globals()
-l = locals()
-__import__('ma', g, l)
-__import__('fft', g, l)
-__import__('linear_algebra', g, l)
-__import__('random_array', g, l)
-__import__('mlab', g, l)
-
-la = linear_algebra
-ra = random_array
+def typecode(a):
+ return a.dtype.char
+def iscontiguous(a):
+ return a.flags.contiguous
+def byteswapped(a):
+ return a.byteswap()
+def itemsize(a):
+ return a.itemsize
Deleted: trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/_na_imports.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -1,76 +0,0 @@
-"""Imports from numarray for numerix, the numarray/Numeric interchangeability
-module. These array functions are used when numarray is chosen.
-"""
-from numarray import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
- Float32, Float64, Complex32, Complex64, Float, Int, Complex,\
- typecode
-import numarray.ieeespecial as _ieee
-inf = infinity = infty = Infinity = _ieee.inf
-isnan = _ieee.isnan
-
-class _TypeNamespace:
- """Numeric compatible type aliases for use with extension functions."""
- Int8 = typecode[Int8]
- UInt8 = typecode[UInt8]
- Int16 = typecode[Int16]
- UInt16 = typecode[UInt16]
- Int32 = typecode[Int32]
- #UInt32 = typecode[UInt32] # Todd: this appears broken
- Float32 = typecode[Float32]
- Float64 = typecode[Float64]
- Complex32 = typecode[Complex32]
- Complex64 = typecode[Complex64]
-
-nx = _TypeNamespace()
-
-from numarray import asarray, dot, fromlist, NumArray, shape, alltrue
-from numarray import all as _all
-
-def all(a, axis=None):
- '''Numpy-compatible version of all()'''
- if axis is None:
- return _all(a)
- return alltrue(a, axis)
-
-class _Matrix(NumArray):
- """_Matrix is a ported, stripped down version of the Numeric Matrix
- class which supplies only matrix multiplication.
- """
- def _rc(self, a):
- if len(shape(a)) == 0:
- return a
- else:
- return Matrix(a)
-
- def __mul__(self, other):
- aother = asarray(other)
- #if len(aother.shape) == 0:
- # return self._rc(self*aother)
- #else:
- # return self._rc(dot(self, aother))
- #return self._rc(dot(self, aother))
- return dot(self, aother)
-
- def __rmul__(self, other):
- aother = asarray(other)
- if len(aother.shape) == 0:
- return self._rc(aother*self)
- else:
- return self._rc(dot(aother, self))
-
- def __imul__(self,other):
- aother = asarray(other)
- self[:] = dot(self, aother)
- return self
-
-def Matrix(data, typecode=None, copy=1, savespace=0):
- """Matrix constructs new matrices from 2D nested lists of numbers"""
- if isinstance(data, type("")):
- raise TypeError("numerix Matrix does not support Numeric matrix string notation. Use nested lists.")
- a = fromlist(data, type=typecode)
- if a.rank == 0:
- a.shape = (1,1)
- elif a.rank == 1:
- a.shape = (1,) + a.shape
- a.__class__ = _Matrix
- return a
Deleted: trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/_nc_imports.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -1,42 +0,0 @@
-from Numeric import array, ravel, reshape, shape, alltrue, sometrue
-from Numeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, \
- Float32, Float64, Complex32, Complex64, Float, Int, Complex
-from numpy import isnan as _isnan
-
-class _TypeNamespace:
- """Numeric compatible type aliases for use with extension functions."""
- Int8 = Int8
- UInt8 = UInt8
- Int16 = Int16
- UInt16 = UInt16
- Int32 = Int32
- UInt32 = UInt32
- Float32 = Float32
- Float64 = Float64
- Complex32 = Complex32
- Complex64 = Complex64
-
-nx = _TypeNamespace()
-
-def isnan(a):
- """y = isnan(x) returns True where x is Not-A-Number"""
- return reshape(array([_isnan(i) for i in ravel(a)],'b'), shape(a))
-
-def all(a, axis=None):
- '''Numpy-compatible version of all()'''
- if axis is None:
- return alltrue(ravel(a))
- else:
- return alltrue(a, axis)
-
-def any(a, axis=None):
- if axis is None:
- return sometrue(ravel(a))
- else:
- return sometrue(a, axis)
-
-
-# inf is useful for testing infinities in results of array divisions
-# (which don't raise exceptions)
-
-inf = infty = infinity = Infinity = (array([1])/0.0)[0]
Deleted: trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/lib/matplotlib/numerix/_sp_imports.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -1,34 +0,0 @@
-try:
- from numpy.oldnumeric import Int8, UInt8, \
- Int16, UInt16, \
- Int32, UInt32, \
- Float32, Float64, \
- Complex32, Complex64, \
- Float, Int, Complex
-except ImportError:
- from numpy import Int8, UInt8, \
- Int16, UInt16, \
- Int32, UInt32, \
- Float32, Float64, \
- Complex32, Complex64, \
- Float, Int, Complex
-
-class _TypeNamespace:
- """Numeric compatible type aliases for use with extension functions."""
- Int8 = Int8
- UInt8 = UInt8
- Int16 = Int16
- UInt16 = UInt16
- Int32 = Int32
- UInt32 = UInt32
- Float32 = Float32
- Float64 = Float64
- Complex32 = Complex32
- Complex64 = Complex64
-
-nx = _TypeNamespace()
-
-from numpy import inf, infty, Infinity
-from numpy.random import rand, randn
-infinity = Infinity
-from numpy import all, isnan, any
Added: trunk/matplotlib/lib/matplotlib/numerix/fft.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/fft.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/fft.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -0,0 +1 @@
+from numpy.oldnumeric.fft import *
Added: trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/linear_algebra.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -0,0 +1 @@
+from numpy.oldnumeric.linear_algebra import *
Added: trunk/matplotlib/lib/matplotlib/numerix/ma.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/ma.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/ma.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -0,0 +1,16 @@
+from matplotlib.numerix import use_maskedarray
+
+from numpy.core.ma import *
+
+if use_maskedarray:
+ from maskedarray import *
+ print "using maskedarray"
+else:
+ from numpy.core.ma import *
+ #print "using ma"
+
+def getmaskorNone(obj):
+ _msk = getmask(obj)
+ if _msk is nomask:
+ return None
+ return _msk
Added: trunk/matplotlib/lib/matplotlib/numerix/mlab.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/mlab.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/mlab.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -0,0 +1,4 @@
+from numpy.oldnumeric.mlab import *
+
+amin = min
+amax = max
Added: trunk/matplotlib/lib/matplotlib/numerix/npyma.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/npyma.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/npyma.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -0,0 +1,10 @@
+from matplotlib.numerix import use_maskedarray
+
+from numpy.core.ma import *
+
+if use_maskedarray:
+ from maskedarray import *
+ print "using maskedarray"
+else:
+ from numpy.core.ma import *
+ #print "using ma"
Added: trunk/matplotlib/lib/matplotlib/numerix/random_array.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/numerix/random_array.py	 (rev 0)
+++ trunk/matplotlib/lib/matplotlib/numerix/random_array.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -0,0 +1 @@
+from numpy.oldnumeric.random_array import *
Modified: trunk/matplotlib/setup.py
===================================================================
--- trunk/matplotlib/setup.py	2007年07月19日 03:53:37 UTC (rev 3573)
+++ trunk/matplotlib/setup.py	2007年07月19日 15:26:27 UTC (rev 3574)
@@ -124,12 +124,6 @@
 'matplotlib.backends',
 'matplotlib.toolkits',
 'matplotlib.numerix',
- 'matplotlib.numerix.mlab',
- 'matplotlib.numerix.ma',
- 'matplotlib.numerix.npyma',
- 'matplotlib.numerix.linear_algebra',
- 'matplotlib.numerix.random_array',
- 'matplotlib.numerix.fft',
 ]
 
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3573
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3573&view=rev
Author: jdh2358
Date: 2007年07月18日 20:53:37 -0700 (2007年7月18日)
Log Message:
-----------
minor revisions to design goals
Modified Paths:
--------------
 trunk/matplotlib/mpl1/DESIGN_GOALS
Modified: trunk/matplotlib/mpl1/DESIGN_GOALS
===================================================================
--- trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 03:35:18 UTC (rev 3572)
+++ trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 03:53:37 UTC (rev 3573)
@@ -28,28 +28,33 @@
 
 Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
 
-How do transformations (linear and nonlinear) play wtih Axis features
-(ticking and gridding). The ideal is an framework in which ticking,
-gridding and labeling work intelligently with arbitrary
-transformations. What is the proper transformation API?
+How do transformations (linear and nonlinear) play with Axis features
+(ticking and gridding). The ideal is a framework in which ticking,
+gridding and labeling work intelligently with arbitrary, user
+supplied, transformations. What is the proper transformation API?
 
 = Objects that talk to the backend "primitives" = 
 
 Have just a few, fairly rich obects, that the backends need to
 understand. Clear candidates are a Path, Text and Image, but despite
-their similar names, don't confuse these with the current matplotlib
-eponymous matplotlib Artists, which are considerably higher level than
-what I'm thinking of here. Each of these will carry their metadata,
-eg a path will carry its stroke color, facecolor, linewidth, etc...,
-and Text will carry its font size, color, etc.... We may need some
-optimizations down the road, but we should start small. For now,
-let's call these objects "primitives".
+their names, don't confuse these with the eponymous matplotlib
+matplotlib Artists, which are higher level than what I'm thinking of
+here (eg matplotlib.text.Text does *a lot* of layout, and this would
+be offloaded ot the backend in this conception of the Text primitive).
+Each of these will carry their metadata, eg a path will carry its
+stroke color, facecolor, linewidth, etc..., and Text will carry its
+font size, color, etc.... We may need some optimizations down the
+road, but we should start small. For now, let's call these objects
+"primitives".
 
+This approach requires the backends to be smarter, but they have to
+handle fewer entities.
+
 = Where do the plot functions live? =
 
-In matplotlib, the plot functions are axes methods and I think there
-is consensus that this is a poor design. Where should these live,
-what should they create, etc?
+In matplotlib, the plot functions are matplotlib.axes.Axes methods and
+I think there is consensus that this is a poor design. Where should
+these live, what should they create, etc?
 
 = How much of an intermediate artist layer do we need? = 
 
@@ -57,7 +62,7 @@
 Line, each of which manage a Path object under the hood? Probably,
 for user convenience and general compability with matplotlib. By
 using traits properly here, many current matplotlib Arists will be
-thin interfaces around one oer more primitives. 
+thin interfaces around one or more primitives. 
 
 I think the whole matplotlib.collections module is poorly designed,
 and should be chucked wholesale, in favor of faster, more elegant,
@@ -65,7 +70,8 @@
 will reduce the need for many of these, eg LineCollection,
 PolygonCollection, etc... Also, everything should be numpy enabled,
 and the sequence-of-python-tuples approach that many of the
-collections take should be dropped.
+collections take should be dropped. Obviously some of the more useful
+things there, like quad meshes, need to be ported and retained.
 
 = Z-ordering, containers, etc = 
 
@@ -73,7 +79,7 @@
 chaco, stuff that looks really useful for picking, interaction, etc...
 We should look at this approach, and think carefully about how this
 should be handled. Paul may be a good candidate for this, since he
-has been working recently on picking.
+has been working recently on the picking API.
 
 = Extension code = 
 
@@ -88,6 +94,10 @@
 be a plus in mpl and beyond. But with the agg license change, I'm
 open to discussion of other approaches.
 
+The major missing piece in ft2font, which is a pretty elaborate CXX
+module. Michael may want to consider alternatives, including looking
+at the agg support for freetype, and the kiva/chaco approach.
+
 I want to do away with *all* GUI extension code. This should live
 outside MPL if at all, eg in a toolkit if we need it. This means
 someone needs to figure out how to get TkInter talking to a python
@@ -106,12 +116,12 @@
 
 = Axis handling = 
 
-The whole concept of the Axes needs to be rethought, in light of the
-fact that we need to support multiple axis objects on one Axes. The
-matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes, and we
-hack two y-axis support (examples/two_scales.py) with some transform
-shenanigans via twinx, but the approach is not generalizable and is
-unwieldy.
+The whole concept of the Axes object needs to be rethought, in light
+of the fact that we need to support multiple axis objects on one Axes.
+The matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes,
+and we hack two y-axis support (examples/two_scales.py) with some
+transform shenanigans via twinx and multiple Axes where one is hidden,
+but the approach is not scalable and is unwieldy.
 
 This will require a fair amount of thought, but we should aim for
 supporting an arbitrary number of axis obects, presumably associated
@@ -122,19 +132,22 @@
 repeated MOVETO and LINETO, for example, which will be incomparably
 faster than using a separate object for each tick.
 
-= Breakage = 
+The other important featiure for axis support is that, for the most
+part, they should be arbitrarily placeable (eg a "detached" axis).
 
+= Breakage =
+
 I think we need to be prepared to break the hell out of matplotlib.
-The API will basically be a total rewrite. pylab will still mostly
-work unchanged -- that is the beauty of pylab -- though API calls on
-return obects may be badly broken. We can mitigate this pain if we
-desire with clever wrapper objects, but once you start calling methods
-on return objects, you join the community of power users, and this is
-the community I'm most willing to inconvenience with breakage. We'll
-probably want to install into a new namespace, eg "mpl", and envision
-both matplotlib and mpl co-existing for some time. In fact, mpl might
-depend on matplotlib initially, eg until a CXX free ft2font is
-available.
+The API will basically be a significant rewrite. pylab will still
+mostly work unchanged -- that is the beauty of pylab -- though API
+calls on return objects may be badly broken. We can mitigate this pain
+if we desire with clever wrapper objects, but once you start calling
+methods on return objects, you join the community of power users, and
+this is the community I'm most willing to inconvenience with breakage.
+We'll probably want to install into a new namespace, eg "mpl", and
+envision both matplotlib and mpl co-existing for some time. In fact,
+mpl might depend on matplotlib initially, eg until a CXX-free ft2font
+is available.
 
 We should expect to be supporting and using matplotlib for a long
 time, since the proposals discussed here imply that it will be a long
@@ -162,9 +175,9 @@
 There is a legitimate need to be able to feed custom objects into
 matplotlib. Recent versions of matplotlib support this with a unit
 registry in the "units" module. A clear use case is plotting with
-native datetime objects, which is supported in 0.90 via the unit
-handling, which should probably be called "custom object handling and
-conversion". This is a deep and complicated subject, involving
+native python datetime objects, which is supported in 0.90 via the
+unit handling, which should probably be called "custom object handling
+and conversion". This is a deep and complicated subject, involving
 questions of where the original data live, how they are converted to
 useful types (arrays of floats) etc. It's worth thinking this about
 as we discuss redesign issues.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3572
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3572&view=rev
Author: jdh2358
Date: 2007年07月18日 20:35:18 -0700 (2007年7月18日)
Log Message:
-----------
minor revisions to design goals
Modified Paths:
--------------
 trunk/matplotlib/mpl1/DESIGN_GOALS
Modified: trunk/matplotlib/mpl1/DESIGN_GOALS
===================================================================
--- trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 03:16:53 UTC (rev 3571)
+++ trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 03:35:18 UTC (rev 3572)
@@ -11,7 +11,7 @@
 Push the data to the backend only once, or only when required. Update
 the transforms in the backend, but do not push transformed data on
 every draw. This is potentially a major win, because we currently
-move the data around on every draw. Eg see how mpl1.py handles pusing
+move the data around on every draw. Eg, see how mpl1.py handles pusing
 the paths when the renderer is set (Figure.set_renderer) but on draw
 commands (Figure.draw) only pushes the current affine.
 
@@ -28,17 +28,22 @@
 
 Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
 
+How do transformations (linear and nonlinear) play wtih Axis features
+(ticking and gridding). The ideal is an framework in which ticking,
+gridding and labeling work intelligently with arbitrary
+transformations. What is the proper transformation API?
+
 = Objects that talk to the backend "primitives" = 
 
 Have just a few, fairly rich obects, that the backends need to
 understand. Clear candidates are a Path, Text and Image, but despite
-similar names, don't confuse these with the current matplotlib Artists
-by the same name, which are considerably higher level than what I'm
-thinking of here. Each of these will carry their metadata, eg a path
-will carry its stroke color, facecolor, linewidth, etc. Text will
-carry its font size, color, etc. We may need some optimizations down
-the road, but start small. For now, let's call these objects
-"primitives".
+their similar names, don't confuse these with the current matplotlib
+eponymous matplotlib Artists, which are considerably higher level than
+what I'm thinking of here. Each of these will carry their metadata,
+eg a path will carry its stroke color, facecolor, linewidth, etc...,
+and Text will carry its font size, color, etc.... We may need some
+optimizations down the road, but we should start small. For now,
+let's call these objects "primitives".
 
 = Where do the plot functions live? =
 
@@ -51,81 +56,85 @@
 Do we want to create high level objects like Circle, Rectangle and
 Line, each of which manage a Path object under the hood? Probably,
 for user convenience and general compability with matplotlib. By
-using traits properly here, these will be thin interfaces around one
-of our primitives. I think the whole collections module is poorly
-designed, and should be chucked wholesale, if favor of faster, more
-elegant, optimizations and special cases. Just having the right Path
-object will reduce the need for many of these, eg LineCollection,
+using traits properly here, many current matplotlib Arists will be
+thin interfaces around one oer more primitives. 
+
+I think the whole matplotlib.collections module is poorly designed,
+and should be chucked wholesale, in favor of faster, more elegant,
+optimizations and special cases. Just having the right Path object
+will reduce the need for many of these, eg LineCollection,
 PolygonCollection, etc... Also, everything should be numpy enabled,
-and the list of python tuples approach that many of the collections
-take should be shed.
+and the sequence-of-python-tuples approach that many of the
+collections take should be dropped.
 
 = Z-ordering, containers, etc = 
 
-Peter has been doing a lot of nice work on z-order and layers and
-stuff like that for chaco, stuff that looks really useful for picking,
-interactive, etc... We should look at their approach, and think
-carefully about how this should be handled. Paul may be a good
-candidate for this, since he has been working on picking.
+Peter has been doing a lot of nice work on z-order and layers for
+chaco, stuff that looks really useful for picking, interaction, etc...
+We should look at this approach, and think carefully about how this
+should be handled. Paul may be a good candidate for this, since he
+has been working recently on picking.
 
 = Extension code = 
 
 I would like to shed all of the CXX extension code -- it is just too
-small a nitch of the python world to base our project on. SWIG is
+small a nitch in the python world to base our project on. SWIG is
 pretty clearly the right choice. mpl1 will use numpy for
 transformations with some carefully chosen extension code where
-necessary, so this gets rid of _transforms.cpp. I also plan to use
-the SWIG agg wrapper, so this gets rid of _backend_agg. If we can
-enhance the SWIG agg wrapper, we can also do images through there.
-Having a fully featured python exposed agg wrapper will be a plus.
-But with the agg license change, I'm open to discussion of
-alternatives.
+necessary, to get rid of _transforms.cpp. I also plan to use the SWIG
+agg wrapper, so this gets rid of _backend_agg. If we can enhance the
+SWIG agg wrapper, we can also do images through there, getting rid of
+_image.cpp. Having a fully featured, python-exposed agg wrapper will
+be a plus in mpl and beyond. But with the agg license change, I'm
+open to discussion of other approaches.
 
 I want to do away with *all* GUI extension code. This should live
-outside MPL if at all, eg in a toolkit, if we need it. This means
-someone needs to figure out how to get tk talking to a python buffer
-object or numpy array. Maintaining the GUI extension code across
-platforms is an unending headache.
+outside MPL if at all, eg in a toolkit if we need it. This means
+someone needs to figure out how to get TkInter talking to a python
+buffer object or a numpy array. Maintaining the GUI extension code
+across platforms is an unending headache.
 
 = Traits = 
 
 I think we should make a major committment to traits and use them from
-the ground up. Without the UI stuff, they add plenty to make them
-worthwhile, especially the validation and notification features. With
-the UI (wx only) , they are a major win for GUI developers. Compare
-the logic for sharing an x-axis in matplotlib transforms with sharex
-with the approach used in mpl1.py with synch-ed affines.
+the ground up. Even without the UI stuff, they add plenty to make
+them worthwhile, especially the validation and notification features.
+With the UI (wx only) , they are a major win for many GUI developers.
+Compare the logic for sharing an x-axis using matplotlib transforms
+with Axes.sharex with the approach used in mpl1.py with sync_trait-ed
+affines.
 
 = Axis handling = 
 
-The whole conception of the Axes needs to be rethought, in light of
-the fact that we need to support multiple axis objects on one Axes.
-The matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes,
-and we hack two y-axis support with some transform shenanigans via
-twinx, but the approach is not generalizable and is unwieldy.
+The whole concept of the Axes needs to be rethought, in light of the
+fact that we need to support multiple axis objects on one Axes. The
+matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes, and we
+hack two y-axis support (examples/two_scales.py) with some transform
+shenanigans via twinx, but the approach is not generalizable and is
+unwieldy.
 
 This will require a fair amount of thought, but we should aim for
 supporting an arbitrary number of axis obects, presumably associated
-with individual artists or primitives, on each Axes. They also need
-to be *much* faster. matplotlib uses Artists for each tick, tickline,
-gridline, ticklabel, etc, and this is mind-numbingsly slow. I have
-some proto-type axis implementations that draw all the ticks with a
-single path using repeated MOVETO and LINETO, for example, which will
-be incomparably faster, than using a separate object from each tick.
+with individual artists or primitives. They also need to be *much*
+faster. matplotlib uses Artists for each tick, tickline, gridline,
+ticklabel, etc, and this is mind-numbingly slow. I have a prototype
+axis implementations that draws the ticks with a single path using
+repeated MOVETO and LINETO, for example, which will be incomparably
+faster than using a separate object for each tick.
 
 = Breakage = 
 
 I think we need to be prepared to break the hell out of matplotlib.
 The API will basically be a total rewrite. pylab will still mostly
-work unchanged -- that is the beauty of pylab - though API calls on
-return obects will probably be badly broken. We can mitigate this
-pain if we desire with clever wrapper objects, but once you start
-calling methods on return objects, you oin the community of power
-users, and this is the community I'm most willing to inconvenience
-with breakage. We'll probably want to install into a new namespace,
-eg "mpl", and envision both matplotlib and mpl co-existing for some
-time. In fact, mpl might depend on matplotlib initially (eg until a
-CXX free ft2font is available)
+work unchanged -- that is the beauty of pylab -- though API calls on
+return obects may be badly broken. We can mitigate this pain if we
+desire with clever wrapper objects, but once you start calling methods
+on return objects, you join the community of power users, and this is
+the community I'm most willing to inconvenience with breakage. We'll
+probably want to install into a new namespace, eg "mpl", and envision
+both matplotlib and mpl co-existing for some time. In fact, mpl might
+depend on matplotlib initially, eg until a CXX free ft2font is
+available.
 
 We should expect to be supporting and using matplotlib for a long
 time, since the proposals discussed here imply that it will be a long
@@ -153,9 +162,9 @@
 There is a legitimate need to be able to feed custom objects into
 matplotlib. Recent versions of matplotlib support this with a unit
 registry in the "units" module. A clear use case is plotting with
-native datetime objects, which is supported in the latest release of
-matplotlib via the unit handling, which should probably be called
-"custom object handling and conversion". This is a deep and
-complictaed subject, involving questions of where the original data
-live, how they are converted to useful types (arrays of floats) etc.
-It's worth thinking about as we discuss redesign issues.
+native datetime objects, which is supported in 0.90 via the unit
+handling, which should probably be called "custom object handling and
+conversion". This is a deep and complicated subject, involving
+questions of where the original data live, how they are converted to
+useful types (arrays of floats) etc. It's worth thinking this about
+as we discuss redesign issues.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3571
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3571&view=rev
Author: jdh2358
Date: 2007年07月18日 20:16:53 -0700 (2007年7月18日)
Log Message:
-----------
minor revisions to design goals
Modified Paths:
--------------
 trunk/matplotlib/mpl1/DESIGN_GOALS
Modified: trunk/matplotlib/mpl1/DESIGN_GOALS
===================================================================
--- trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 03:00:21 UTC (rev 3570)
+++ trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 03:16:53 UTC (rev 3571)
@@ -2,56 +2,65 @@
 and all of this is open to discussion. What I present below is pretty
 ambitious, so if there is support, we will need significant
 contributions from several developers for several months. Ideally, we
-would get a good sketch working, and then organize a spint (4 days?)
+would get a good sketch working, and then organize a spint (3-4 days?)
 for late August, where we try get as far as possible to making this
 viable.
 
-= data copying =
+= Data copying =
 
-Push the data to the backend only once, or only when required. update
-the transforms to the backend, but do not push transformed data on
+Push the data to the backend only once, or only when required. Update
+the transforms in the backend, but do not push transformed data on
 every draw. This is potentially a major win, because we currently
-move the data around on every draw
+move the data around on every draw. Eg see how mpl1.py handles pusing
+the paths when the renderer is set (Figure.set_renderer) but on draw
+commands (Figure.draw) only pushes the current affine.
 
+= Transformations = 
 
-= transformations = 
-
 Support a normal transformation architecture. The current draft
-implmentation assumes one nonlinear transformation, which happens at a
-high layer, and all transformations after that are affines. Currently
-there are three affines: the transformation from view limits -> axes
-units, the transformation from axes units to normalized figure untis,
-and the transformation from normalized figure units to display
+implementation assumes one nonlinear transformation, which happens at
+a high layer, and all transformations after that are affines. In the
+mpl1 draft, there are three affines: the transformation from view
+limits -> axes units (AxesCoords.affineview), the transformation from
+axes units to normalized figure units (AxesCoords.affineaxes), and the
+transformation from normalized figure units to display
+(Renderer.affine)
 
 Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
 
-= objects that talk to the backend "primitives" = 
+= Objects that talk to the backend "primitives" = 
 
 Have just a few, fairly rich obects, that the backends need to
 understand. Clear candidates are a Path, Text and Image, but despite
-some similar names, don't confuse these with the current matplotlib
-Artists by the same name, which are considerably higher level than
-what I'm thinking of here. Each of these will carry their metadata,
-eg a path will carry its stroke color, facecolor, linewidth, etc..
-Text will carry its font size, color, etc. We may need some
-optimizations down the road, but start small. For now, let's call
-these objects "primitives".
+similar names, don't confuse these with the current matplotlib Artists
+by the same name, which are considerably higher level than what I'm
+thinking of here. Each of these will carry their metadata, eg a path
+will carry its stroke color, facecolor, linewidth, etc. Text will
+carry its font size, color, etc. We may need some optimizations down
+the road, but start small. For now, let's call these objects
+"primitives".
 
-= where do the plot functions live? =
+= Where do the plot functions live? =
 
 In matplotlib, the plot functions are axes methods and I think there
 is consensus that this is a poor design. Where should these live,
 what should they create, etc?
 
-= how much of an intermediate artist layer do we need = 
+= How much of an intermediate artist layer do we need? = 
 
 Do we want to create high level objects like Circle, Rectangle and
 Line, each of which manage a Path object under the hood? Probably,
 for user convenience and general compability with matplotlib. By
 using traits properly here, these will be thin interfaces around one
-of our primitives.
+of our primitives. I think the whole collections module is poorly
+designed, and should be chucked wholesale, if favor of faster, more
+elegant, optimizations and special cases. Just having the right Path
+object will reduce the need for many of these, eg LineCollection,
+PolygonCollection, etc... Also, everything should be numpy enabled,
+and the list of python tuples approach that many of the collections
+take should be shed.
 
-= z-ordering, containers, etc = 
+= Z-ordering, containers, etc = 
 
 Peter has been doing a lot of nice work on z-order and layers and
 stuff like that for chaco, stuff that looks really useful for picking,
@@ -59,7 +68,7 @@
 carefully about how this should be handled. Paul may be a good
 candidate for this, since he has been working on picking.
 
-= extension code = 
+= Extension code = 
 
 I would like to shed all of the CXX extension code -- it is just too
 small a nitch of the python world to base our project on. SWIG is
@@ -67,17 +76,18 @@
 transformations with some carefully chosen extension code where
 necessary, so this gets rid of _transforms.cpp. I also plan to use
 the SWIG agg wrapper, so this gets rid of _backend_agg. If we can
-enhance the SWIG agg wrapper, we can also do images through here.
-Having a fully featured python agg wrapper will be a plus. But with
-the agg license change, I'm open to discussion of alternatives.
+enhance the SWIG agg wrapper, we can also do images through there.
+Having a fully featured python exposed agg wrapper will be a plus.
+But with the agg license change, I'm open to discussion of
+alternatives.
 
 I want to do away with *all* GUI extension code. This should live
-outside MPL, eg in a toolkit, if we need it. This means someone needs
-to figure out how to get tk talking to a python buffer or numpy array.
-Maintaining the GUI extension code across platforms is an unending
-headache.
+outside MPL if at all, eg in a toolkit, if we need it. This means
+someone needs to figure out how to get tk talking to a python buffer
+object or numpy array. Maintaining the GUI extension code across
+platforms is an unending headache.
 
-= traits = 
+= Traits = 
 
 I think we should make a major committment to traits and use them from
 the ground up. Without the UI stuff, they add plenty to make them
@@ -86,29 +96,36 @@
 the logic for sharing an x-axis in matplotlib transforms with sharex
 with the approach used in mpl1.py with synch-ed affines.
 
-= axis handling = 
+= Axis handling = 
 
 The whole conception of the Axes needs to be rethought, in light of
 the fact that we need to support multiple axis objects on one Axes.
 The matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes,
 and we hack two y-axis support with some transform shenanigans via
-twinx, but the approach is not generalizable and is unweildy.
+twinx, but the approach is not generalizable and is unwieldy.
 
 This will require a fair amount of thought, but we should aim for
 supporting an arbitrary number of axis obects, presumably associated
 with individual artists or primitives, on each Axes. They also need
 to be *much* faster. matplotlib uses Artists for each tick, tickline,
-gridline, ticklabel, etc, and this is mind-numbingsly slow. 
+gridline, ticklabel, etc, and this is mind-numbingsly slow. I have
+some proto-type axis implementations that draw all the ticks with a
+single path using repeated MOVETO and LINETO, for example, which will
+be incomparably faster, than using a separate object from each tick.
 
-= breakage = 
+= Breakage = 
 
 I think we need to be prepared to break the hell out of matplotlib.
 The API will basically be a total rewrite. pylab will still mostly
 work unchanged -- that is the beauty of pylab - though API calls on
-return obects will probably be badly broken. We'll probably want to
-install into a new namespace, eg mpl, and envision both matplotlib and
-mpl co-existing for some time. In fact, mpl might depend on
-matplotlib for a while (eg until a CXX free ft2font is available)
+return obects will probably be badly broken. We can mitigate this
+pain if we desire with clever wrapper objects, but once you start
+calling methods on return objects, you oin the community of power
+users, and this is the community I'm most willing to inconvenience
+with breakage. We'll probably want to install into a new namespace,
+eg "mpl", and envision both matplotlib and mpl co-existing for some
+time. In fact, mpl might depend on matplotlib initially (eg until a
+CXX free ft2font is available)
 
 We should expect to be supporting and using matplotlib for a long
 time, since the proposals discussed here imply that it will be a long
@@ -120,10 +137,10 @@
 Or we could forget all this wild speculation and resume our normally
 scheduled lives.
 
-= chaco and kiva = 
+= Chaco and Kiva = 
 
 It is a good idea for an enterprising developer to take a careful look
-at tghe current Chaco and Kiva to see if we can further integrate with
+at the current Chaco and Kiva to see if we can further integrate with
 them. I am gun shy because they seem formiddable and complex, and one
 of my major goals here is to streamline and simplify, but they are
 incredible pieces of work and we need to carefully consider them,
@@ -131,14 +148,14 @@
 core, eg traits, increasing the possibility of synergies.
 
 
-= unit handling, custom object types = 
+= Unit handling, custom object types = 
 
 There is a legitimate need to be able to feed custom objects into
 matplotlib. Recent versions of matplotlib support this with a unit
-registry. A clear use case is plotting with native datetime objects,
-which is supported in the latest release of matplotlib via the unit
-handling, which should probably be called "custom object handling and
-conversion". This is a deep and complicaed subect, involving
-questions of where the original data live, how they are converted to
-useful types (arrays of floats) etc. It's worth thinking about as we
-discuss redesign issues.
+registry in the "units" module. A clear use case is plotting with
+native datetime objects, which is supported in the latest release of
+matplotlib via the unit handling, which should probably be called
+"custom object handling and conversion". This is a deep and
+complictaed subject, involving questions of where the original data
+live, how they are converted to useful types (arrays of floats) etc.
+It's worth thinking about as we discuss redesign issues.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3570
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3570&view=rev
Author: jdh2358
Date: 2007年07月18日 20:00:21 -0700 (2007年7月18日)
Log Message:
-----------
minor revisions to design goals
Modified Paths:
--------------
 trunk/matplotlib/mpl1/DESIGN_GOALS
Modified: trunk/matplotlib/mpl1/DESIGN_GOALS
===================================================================
--- trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 02:40:15 UTC (rev 3569)
+++ trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 03:00:21 UTC (rev 3570)
@@ -19,45 +19,50 @@
 Support a normal transformation architecture. The current draft
 implmentation assumes one nonlinear transformation, which happens at a
 high layer, and all transformations after that are affines. Currently
-there are two affines: the transformation from view limits -> axes
+there are three affines: the transformation from view limits -> axes
 units, the transformation from axes units to normalized figure untis,
 and the transformation from normalized figure units to display
 
-do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
+Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
 
 = objects that talk to the backend "primitives" = 
 
-Have just a few, fairly rich obects the backends need to understand.
-clear candidates are a Path, Text and Image. Each of these will carry
-their metadata, eg a path will carry its stroke color, facecolor,
-linewidth, etc.. Text will carry its font size, color, etc. We may
-need some optimizations down the road, but start small. For now,
-let's call these objects primitives
+Have just a few, fairly rich obects, that the backends need to
+understand. Clear candidates are a Path, Text and Image, but despite
+some similar names, don't confuse these with the current matplotlib
+Artists by the same name, which are considerably higher level than
+what I'm thinking of here. Each of these will carry their metadata,
+eg a path will carry its stroke color, facecolor, linewidth, etc..
+Text will carry its font size, color, etc. We may need some
+optimizations down the road, but start small. For now, let's call
+these objects "primitives".
 
 = where do the plot functions live? =
 
-In matplotlib, the plot functions are axes methods and this is a poor
-design. Where should these live, what should they create, etc?
+In matplotlib, the plot functions are axes methods and I think there
+is consensus that this is a poor design. Where should these live,
+what should they create, etc?
 
 = how much of an intermediate artist layer do we need = 
 
 Do we want to create high level objects like Circle, Rectangle and
-Line, each of which manage a Path object under the hood? Probably.
-By using traits properly here, these will be thin interfaces around
-one of our primitives.
+Line, each of which manage a Path object under the hood? Probably,
+for user convenience and general compability with matplotlib. By
+using traits properly here, these will be thin interfaces around one
+of our primitives.
 
 = z-ordering, containers, etc = 
 
 Peter has been doing a lot of nice work on z-order and layers and
 stuff like that for chaco, stuff that looks really useful for picking,
 interactive, etc... We should look at their approach, and think
-carefully about how this should be handled. Paul is a good candidate
-for this.
+carefully about how this should be handled. Paul may be a good
+candidate for this, since he has been working on picking.
 
 = extension code = 
 
 I would like to shed all of the CXX extension code -- it is just too
-small a nitch of the python world to base our proect on. SWIG is
+small a nitch of the python world to base our project on. SWIG is
 pretty clearly the right choice. mpl1 will use numpy for
 transformations with some carefully chosen extension code where
 necessary, so this gets rid of _transforms.cpp. I also plan to use
@@ -67,33 +72,40 @@
 the agg license change, I'm open to discussion of alternatives.
 
 I want to do away with *all* GUI extension code. This should live
-outside MPL, eg in a toolkit, if we need it. This means someone
-(Michael is probably a good choice) needs to figure out how to get tk
-talking to a python buffer or numpy array. Maintaining the GUI
-extension code is a drag.
+outside MPL, eg in a toolkit, if we need it. This means someone needs
+to figure out how to get tk talking to a python buffer or numpy array.
+Maintaining the GUI extension code across platforms is an unending
+headache.
 
 = traits = 
 
 I think we should make a major committment to traits and use them from
-the ground up. w/o the UI stuff, they add plenty to make them
-worthwhile. With the UI (wx only) , they are a major win for GUI
-developers.
+the ground up. Without the UI stuff, they add plenty to make them
+worthwhile, especially the validation and notification features. With
+the UI (wx only) , they are a major win for GUI developers. Compare
+the logic for sharing an x-axis in matplotlib transforms with sharex
+with the approach used in mpl1.py with synch-ed affines.
 
 = axis handling = 
 
-The whole conception of the Axes needs to be reworked, in light of the
-fact that we need to support multiple axis objects on one Axes. This
-will require a fair amount of thought, but we should aim for
+The whole conception of the Axes needs to be rethought, in light of
+the fact that we need to support multiple axis objects on one Axes.
+The matplotlib implementation assumes 1 xaxis and 1 yaxis per Axes,
+and we hack two y-axis support with some transform shenanigans via
+twinx, but the approach is not generalizable and is unweildy.
+
+This will require a fair amount of thought, but we should aim for
 supporting an arbitrary number of axis obects, presumably associated
 with individual artists or primitives, on each Axes. They also need
 to be *much* faster. matplotlib uses Artists for each tick, tickline,
-gridline, ticklabel, etc, and this is mind-numbingsly slow.
+gridline, ticklabel, etc, and this is mind-numbingsly slow. 
 
 = breakage = 
 
-I think we need to be prepared to break the hell out of this thing.
+I think we need to be prepared to break the hell out of matplotlib.
 The API will basically be a total rewrite. pylab will still mostly
-work unchanged -- that is the beauty of pylab. We'll probably want to
+work unchanged -- that is the beauty of pylab - though API calls on
+return obects will probably be badly broken. We'll probably want to
 install into a new namespace, eg mpl, and envision both matplotlib and
 mpl co-existing for some time. In fact, mpl might depend on
 matplotlib for a while (eg until a CXX free ft2font is available)
@@ -101,16 +113,32 @@
 We should expect to be supporting and using matplotlib for a long
 time, since the proposals discussed here imply that it will be a long
 wait until mpl1 is feature complete with matplotlib. In fact, we could
-rightly consider this to be the mpl2 proposal, and keep releaseing
+rightly consider this to be the mpl2 proposal, and keep releasing
 matplotlib ehancements to 1.0 and beyond w/o signfificant breakage.
 It's a nominal difference so I don't really have a preference.
 
+Or we could forget all this wild speculation and resume our normally
+scheduled lives.
+
 = chaco and kiva = 
 
-This is probably a good idea for an enterprising developer to take a
-careful look at Chaco and Kiva to see if we can integrate with them.
-I am gunshy because they seem formiddable and complex, and one of my
-maor goals here is to streamline and simplify, but they are incredible
-pieces of work and we need to consider them, especially if we
-integrate other parts of the enthought suite into our core, eg traits
+It is a good idea for an enterprising developer to take a careful look
+at tghe current Chaco and Kiva to see if we can further integrate with
+them. I am gun shy because they seem formiddable and complex, and one
+of my major goals here is to streamline and simplify, but they are
+incredible pieces of work and we need to carefully consider them,
+especially as we integrate other parts of the enthought suite into our
+core, eg traits, increasing the possibility of synergies.
 
+
+= unit handling, custom object types = 
+
+There is a legitimate need to be able to feed custom objects into
+matplotlib. Recent versions of matplotlib support this with a unit
+registry. A clear use case is plotting with native datetime objects,
+which is supported in the latest release of matplotlib via the unit
+handling, which should probably be called "custom object handling and
+conversion". This is a deep and complicaed subect, involving
+questions of where the original data live, how they are converted to
+useful types (arrays of floats) etc. It's worth thinking about as we
+discuss redesign issues.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2007年07月19日 02:40:18
Revision: 3569
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3569&view=rev
Author: jdh2358
Date: 2007年07月18日 19:40:15 -0700 (2007年7月18日)
Log Message:
-----------
added design goals doc
Modified Paths:
--------------
 trunk/matplotlib/mpl1/mpl1.py
 trunk/matplotlib/mpl1/mtraits.py
Added Paths:
-----------
 trunk/matplotlib/mpl1/DESIGN_GOALS
Added: trunk/matplotlib/mpl1/DESIGN_GOALS
===================================================================
--- trunk/matplotlib/mpl1/DESIGN_GOALS	 (rev 0)
+++ trunk/matplotlib/mpl1/DESIGN_GOALS	2007年07月19日 02:40:15 UTC (rev 3569)
@@ -0,0 +1,116 @@
+Here are some of the things I would like to accomplish with mpl1. Any
+and all of this is open to discussion. What I present below is pretty
+ambitious, so if there is support, we will need significant
+contributions from several developers for several months. Ideally, we
+would get a good sketch working, and then organize a spint (4 days?)
+for late August, where we try get as far as possible to making this
+viable.
+
+= data copying =
+
+Push the data to the backend only once, or only when required. update
+the transforms to the backend, but do not push transformed data on
+every draw. This is potentially a major win, because we currently
+move the data around on every draw
+
+
+= transformations = 
+
+Support a normal transformation architecture. The current draft
+implmentation assumes one nonlinear transformation, which happens at a
+high layer, and all transformations after that are affines. Currently
+there are two affines: the transformation from view limits -> axes
+units, the transformation from axes units to normalized figure untis,
+and the transformation from normalized figure units to display
+
+do we want to use 3x3 or 4x4 to leave the door open for 3D developers?
+
+= objects that talk to the backend "primitives" = 
+
+Have just a few, fairly rich obects the backends need to understand.
+clear candidates are a Path, Text and Image. Each of these will carry
+their metadata, eg a path will carry its stroke color, facecolor,
+linewidth, etc.. Text will carry its font size, color, etc. We may
+need some optimizations down the road, but start small. For now,
+let's call these objects primitives
+
+= where do the plot functions live? =
+
+In matplotlib, the plot functions are axes methods and this is a poor
+design. Where should these live, what should they create, etc?
+
+= how much of an intermediate artist layer do we need = 
+
+Do we want to create high level objects like Circle, Rectangle and
+Line, each of which manage a Path object under the hood? Probably.
+By using traits properly here, these will be thin interfaces around
+one of our primitives.
+
+= z-ordering, containers, etc = 
+
+Peter has been doing a lot of nice work on z-order and layers and
+stuff like that for chaco, stuff that looks really useful for picking,
+interactive, etc... We should look at their approach, and think
+carefully about how this should be handled. Paul is a good candidate
+for this.
+
+= extension code = 
+
+I would like to shed all of the CXX extension code -- it is just too
+small a nitch of the python world to base our proect on. SWIG is
+pretty clearly the right choice. mpl1 will use numpy for
+transformations with some carefully chosen extension code where
+necessary, so this gets rid of _transforms.cpp. I also plan to use
+the SWIG agg wrapper, so this gets rid of _backend_agg. If we can
+enhance the SWIG agg wrapper, we can also do images through here.
+Having a fully featured python agg wrapper will be a plus. But with
+the agg license change, I'm open to discussion of alternatives.
+
+I want to do away with *all* GUI extension code. This should live
+outside MPL, eg in a toolkit, if we need it. This means someone
+(Michael is probably a good choice) needs to figure out how to get tk
+talking to a python buffer or numpy array. Maintaining the GUI
+extension code is a drag.
+
+= traits = 
+
+I think we should make a major committment to traits and use them from
+the ground up. w/o the UI stuff, they add plenty to make them
+worthwhile. With the UI (wx only) , they are a major win for GUI
+developers.
+
+= axis handling = 
+
+The whole conception of the Axes needs to be reworked, in light of the
+fact that we need to support multiple axis objects on one Axes. This
+will require a fair amount of thought, but we should aim for
+supporting an arbitrary number of axis obects, presumably associated
+with individual artists or primitives, on each Axes. They also need
+to be *much* faster. matplotlib uses Artists for each tick, tickline,
+gridline, ticklabel, etc, and this is mind-numbingsly slow.
+
+= breakage = 
+
+I think we need to be prepared to break the hell out of this thing.
+The API will basically be a total rewrite. pylab will still mostly
+work unchanged -- that is the beauty of pylab. We'll probably want to
+install into a new namespace, eg mpl, and envision both matplotlib and
+mpl co-existing for some time. In fact, mpl might depend on
+matplotlib for a while (eg until a CXX free ft2font is available)
+
+We should expect to be supporting and using matplotlib for a long
+time, since the proposals discussed here imply that it will be a long
+wait until mpl1 is feature complete with matplotlib. In fact, we could
+rightly consider this to be the mpl2 proposal, and keep releaseing
+matplotlib ehancements to 1.0 and beyond w/o signfificant breakage.
+It's a nominal difference so I don't really have a preference.
+
+= chaco and kiva = 
+
+This is probably a good idea for an enterprising developer to take a
+careful look at Chaco and Kiva to see if we can integrate with them.
+I am gunshy because they seem formiddable and complex, and one of my
+maor goals here is to streamline and simplify, but they are incredible
+pieces of work and we need to consider them, especially if we
+integrate other parts of the enthought suite into our core, eg traits
+
Modified: trunk/matplotlib/mpl1/mpl1.py
===================================================================
--- trunk/matplotlib/mpl1/mpl1.py	2007年07月18日 21:52:01 UTC (rev 3568)
+++ trunk/matplotlib/mpl1/mpl1.py	2007年07月19日 02:40:15 UTC (rev 3569)
@@ -1,3 +1,4 @@
+# see install instructions for enthrought traits2 in mtraits
 import enthought.traits.api as traits
 
 from matplotlib import agg
@@ -395,7 +396,7 @@
 y2 = 10*npy.exp(-x)
 
 line1 = line(x, y1, color='blue', linewidth=2.0)
-line1.affine = coords1.affine
+line1.sync_trait('affine', coords1)
 
 fig.add_path(line1)
 
Modified: trunk/matplotlib/mpl1/mtraits.py
===================================================================
--- trunk/matplotlib/mpl1/mtraits.py	2007年07月18日 21:52:01 UTC (rev 3568)
+++ trunk/matplotlib/mpl1/mtraits.py	2007年07月19日 02:40:15 UTC (rev 3569)
@@ -1,14 +1,19 @@
 """
 Install instructions for traits 2.0
 
+ # blow away old enthought
 rm -rf ~/dev/lib/python2.4/site-packages/enthought.*
 
- easy_install --install-dir=~/dev/lib/python2.4/site-packages --prefix=~/dev -f http://code.enthought.com/enstaller/eggs/source/unstable/ enthought.etsconfig enthought.util enthought.debug
+ # get easy_install, if necessary
+ wget http://peak.telecommunity.com/dist/ez_setup.py
+ sudo python sez_setup.py
 
+ sudo easy_install -f http://code.enthought.com/enstaller/eggs/source/unstable/ enthought.etsconfig enthought.util enthought.debug
+
 svn co https://svn.enthought.com/svn/enthought/branches/enthought.traits_2.0 enthought_traits
 
 cd enthought_traits/
- python setup.py install --prefix=~/dev
+ sudo python setup.py install 
 
 
 """
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3568
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3568&view=rev
Author: jdh2358
Date: 2007年07月18日 14:52:01 -0700 (2007年7月18日)
Log Message:
-----------
screwing aournd with delegates
Modified Paths:
--------------
 trunk/matplotlib/mpl1/test.py
Modified: trunk/matplotlib/mpl1/test.py
===================================================================
--- trunk/matplotlib/mpl1/test.py	2007年07月18日 21:30:12 UTC (rev 3567)
+++ trunk/matplotlib/mpl1/test.py	2007年07月18日 21:52:01 UTC (rev 3568)
@@ -1,15 +1,36 @@
 import numpy
-from enthought.traits.api import HasTraits, Array
-import mtraits
+from enthought.traits.api import HasTraits, Array, Delegate, Trait
 
+Affine = Array('d', (3,3),
+ value=numpy.array([[1,0,0], [0,1,0], [0,0,1]], numpy.float_))
 
-class Path(HasTraits):
- """
- The path is an object that talks to the backends, and is an
- intermediary between the high level path artists like Line and
- Polygon, and the backend renderer
- """
- strokecolor = mtraits.color('white')
+class C(HasTraits):
+ affine1 = Affine
+ affine2 = Affine 
+ affine = Affine
 
-p = Path()
-print 'strokecolor', p.strokecolor
+ def _affine1_changed(self, old, new):
+ self.affine = numpy.dot(new, self.affine2)
+
+ def _affine2_changed(self, old, new):
+ self.affine = numpy.dot(self.affine1, new)
+
+
+class D(HasTraits):
+ affine = Delegate('c')
+ c = Trait(C)
+
+ 
+c = C()
+d = D()
+d.affine = c.affine
+
+
+print 'before c', type(c.affine), c.affine
+print 'before d', type(d.affine), d.affine
+
+c.affine1 = numpy.random.rand(3,3)
+print 'after c', type(c.affine), c.affine
+print 'after d', type(d.affine), d.affine
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2007年07月18日 21:30:16
Revision: 3567
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3567&view=rev
Author: jdh2358
Date: 2007年07月18日 14:30:12 -0700 (2007年7月18日)
Log Message:
-----------
playing around with mpl1 api
Modified Paths:
--------------
 trunk/matplotlib/mpl1/mpl1.py
 trunk/matplotlib/mpl1/mtraits.py
Added Paths:
-----------
 trunk/matplotlib/mpl1/scratch.py
 trunk/matplotlib/mpl1/test.py
Modified: trunk/matplotlib/mpl1/mpl1.py
===================================================================
--- trunk/matplotlib/mpl1/mpl1.py	2007年07月18日 20:38:32 UTC (rev 3566)
+++ trunk/matplotlib/mpl1/mpl1.py	2007年07月18日 21:30:12 UTC (rev 3567)
@@ -1,5 +1,4 @@
-from matplotlib.enthought.traits import HasTraits
-import matplotlib.enthought.traits as traits
+import enthought.traits.api as traits
 
 from matplotlib import agg
 import numpy as npy
@@ -54,7 +53,7 @@
 identity = Identity()
 
 
-class Path(HasTraits):
+class Path(traits.HasTraits):
 """
 The path is an object that talks to the backends, and is an
 intermediary between the high level path artists like Line and
@@ -102,6 +101,7 @@
 def color_to_rgba8(self, color):
 if color is None: return None
 rgba = [int(255*c) for c in color.r, color.g, color.b, color.a]
+
 return agg.rgba8(*rgba)
 
 # coordinates:
@@ -178,7 +178,7 @@
 self.scanlinebin = agg.scanline_bin()
 
 def add_path(self, pathid, path):
- pathid = Renderer.add_path(self, pathid, path)
+ Renderer.add_path(self, pathid, path)
 self.aggpathd[pathid] = AggPath(path)
 
 def remove_path(self, pathid):
@@ -274,6 +274,7 @@
 path.verts = model(X)
 path.codes = codes 
 path.fillcolor = None
+ path.strokecolor = color
 path.strokewidth = linewidth
 path.alpha = alpha
 path.antialiased = antialiased
@@ -281,43 +282,49 @@
 
 
 
-class AxesCoords(HasTraits):
+class AxesCoords(traits.HasTraits):
 xviewlim = mtraits.interval
 yviewlim = mtraits.interval
 affineview = mtraits.affine
 affineaxes = mtraits.affine 
 affine = mtraits.affine 
 
+ 
 def _affineview_changed(self, old, new):
- self.affine = npy.dot(
- npy.dot(self.affineaxes, new), self.affinedata)
+ print 'affine view changed'
+ self.affine = npy.dot(self.affineaxes, new)
 
 def _affineaxes_changed(self, old, new):
- self.affine = npy.dot(
- npy.dot(new, self.affineview), self.affinedata)
+ print 'affine axes changed'
+ self.affine = npy.dot(new, self.affineview)
 
-
+ 
 def _xviewlim_changed(self, old, new):
+ print 'xviewlim changed'
 xmin, xmax = new
 scale = 1./(xmax-xmin)
 tx = -xmin*scale
 self.affineview[0][0] = scale
 self.affineview[0][-1] = tx
-
+ self.affine = npy.dot(self.affineaxes, self.affineview)
+ print '\t', self.affine
+ 
 def _yviewlim_changed(self, old, new):
+ print 'yviewlim changed'
 ymin, ymax = new
 scale = 1./(ymax-ymin)
 ty = -ymin*scale
 self.affineview[1][1] = scale
 self.affineview[1][-1] = ty
-
+ self.affine = npy.dot(self.affineaxes, self.affineview)
+ print '\t', self.affine
 
 
 class Figure:
 def __init__(self):
 self.renderer = None
 self._pathid = 0
- self._pathd = dict()
+ self.pathd = dict()
 
 def add_path(self, path):
 id_ = self._pathid
@@ -336,6 +343,7 @@
 raise RuntimeError('call set_renderer renderer first')
 
 for pathid, path in self.pathd.items():
+ print 'path', pathid, path.affine
 renderer.push_affine(path.affine)
 renderer.render_path(pathid)
 
@@ -374,25 +382,12 @@
 [0,0,1]],
 dtype=npy.float_)
 
-xlim = mtraits.interval()
-ylim1 = mtraits.interval()
-ylim2 = mtraits.interval()
 
-affineaxes = affine_axes([0.1, 0.1, 0.4, 0.4]) # lower, left quadrant
-
 coords1 = AxesCoords()
-coords1.xlim = xlim
-coords1.ylim = ylim1
-print 'typedata', affineaxes.shape, affineaxes.dtype
-coords1.affineaxes = affineaxes
+coords1.affineaxes = affine_axes([0.55, 0.55, 0.4, 0.4]) # upper right quadrant
 
-coords2 = AxesCoords()
-coords2.xlim = xlim
-coords2.ylim = ylim2
-coords2.affineaxes = affineaxes
 
 
-
 fig = Figure()
 
 x = npy.arange(0, 10, 0.01)
@@ -400,22 +395,32 @@
 y2 = 10*npy.exp(-x)
 
 line1 = line(x, y1, color='blue', linewidth=2.0)
-line1.affine = coords1.affime
+line1.affine = coords1.affine
 
-line2 = line(x, y2, color='red', linewidth=2.0)
-line2.affine = coords1.affime
-
 fig.add_path(line1)
-fig.add_path(line2)
 
+print 'before', line1.affine
 # update the view limits, all the affines should be automagically updated
-xlim = 0,10
-ylim1 = -1.1, 1.1
-ylim2 = 0, 10
+coords1.xviewlim = 0, 10
+coords1.yviewlim = -1.1, 1.1
 
+print 'after', line1.affine
 
-renderer = RendererAgg(600,400)
-fig.set_renderer(renderer)
-fig.draw()
-print 'renderer affine', renderer.affine
-renderer.show()
+
+if 0:
+ coords2 = AxesCoords()
+ coords2.xviewlim = coords1.xviewlim # share the x axis
+ coords2.affineaxes = affine_axes([0.1, 0.1, 0.4, 0.4]) # lower left quadrant
+
+
+ line2 = line(x, y2, color='red', linewidth=2.0)
+ line2.affine = coords2.affine
+ coords2.yviewlim = 0, 10
+ fig.add_path(line2)
+
+
+if 0:
+ renderer = RendererAgg(600,400)
+ fig.set_renderer(renderer)
+ fig.draw()
+ renderer.show()
Modified: trunk/matplotlib/mpl1/mtraits.py
===================================================================
--- trunk/matplotlib/mpl1/mtraits.py	2007年07月18日 20:38:32 UTC (rev 3566)
+++ trunk/matplotlib/mpl1/mtraits.py	2007年07月18日 21:30:12 UTC (rev 3567)
@@ -1,3 +1,17 @@
+"""
+Install instructions for traits 2.0
+
+ rm -rf ~/dev/lib/python2.4/site-packages/enthought.*
+
+ easy_install --install-dir=~/dev/lib/python2.4/site-packages --prefix=~/dev -f http://code.enthought.com/enstaller/eggs/source/unstable/ enthought.etsconfig enthought.util enthought.debug
+
+ svn co https://svn.enthought.com/svn/enthought/branches/enthought.traits_2.0 enthought_traits
+
+ cd enthought_traits/
+ python setup.py install --prefix=~/dev
+
+
+"""
 # Here is some example code showing how to define some representative
 # rc properties and construct a matplotlib artist using traits.
 # Because matplotlib ships with enthought traits already, you can run
@@ -7,7 +21,7 @@
 # below.
 
 import sys, os, re
-import matplotlib.enthought.traits as traits
+import enthought.traits.api as traits
 from matplotlib.cbook import is_string_like
 from matplotlib import colors as mcolors
 import numpy as npy
@@ -86,7 +100,7 @@
 
 def path_exists(ob, name, val):
 os.path.exists(val)
-linestyles = ('-', '--', '-.', ':', 'steps', 'None')
+linestyles = ('-', '--', '-.', ':', 'steps')
 TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN = range(4)
 linemarkers = (None, '.', ',', 'o', '^', 'v', '<', '>', 's',
 '+', 'x', 'd', 'D', '|', '_', 'h', 'H',
@@ -95,7 +109,7 @@
 TICKRIGHT,
 TICKUP,
 TICKDOWN,
- 'None')
+ )
 
 
 linewidth = traits.Float(0.5)
@@ -105,9 +119,10 @@
 markersize = traits.Float(6)
 antialiased = flexible_true_trait
 alpha = traits.Range(0., 1., 0.)
-interval = traits.Array('d', (2,))
-affine = traits.Array('d', (3,3))
-verts = traits.Array('d')
-codes = traits.Array('b')
+interval = traits.Array('d', (2,), npy.array([0.0, 1.0], npy.float_))
+affine = traits.Array('d', (3,3),
+ npy.array([[1,0,0],[0,1,0],[0,0,1]], npy.float_))
+verts = traits.Array('d', value=npy.array([[0,0],[0,0]], npy.float_))
+codes = traits.Array('b', value=npy.array([0,0], dtype=npy.uint8))
 
 
Added: trunk/matplotlib/mpl1/scratch.py
===================================================================
--- trunk/matplotlib/mpl1/scratch.py	 (rev 0)
+++ trunk/matplotlib/mpl1/scratch.py	2007年07月18日 21:30:12 UTC (rev 3567)
@@ -0,0 +1,150 @@
+
+class Axis(Artist):
+ tickcolor = mtraits.color('black')
+ axiscolor = mtraits.color('black')
+ tickwidth = mtraits.linewidth(0.5)
+ viewlim = mtraits.interval
+ tickpath = mtraits.path
+ axispath = mtraits.path
+ 
+ def __init__(self, figure): 
+ self.figure = figure
+ self.pathids = set()
+ 
+class XAxis(Axis):
+ def __init__(self, figure, **kwargs):
+ Axis.__init__(self, figure, **kwargs)
+
+ def set_ticks(self, yloc, ysize, ticks, fmt):
+ # we'll deal with locators, formatter and autoscaling later...
+ # todo, remove old paths
+
+ for pathid in self.pathids:
+ self.figure.remove_path(pathid)
+ 
+ codes = []
+ verts = []
+ tickmin = yloc-ysize/2.
+ tickmax = yloc+ysize/2.
+ for tick in ticks:
+ codes.append(Path.MOVETO)
+ verts.append((tick, tickmin))
+ codes.append(Path.LINETO)
+ verts.append((tick, tickmax))
+ 
+
+ path = Path()
+ path.verts = npy.array(verts)
+ path.codes = npy.array(codes)
+ path.strokecolor = self.tickcolor
+ path.fillcolor = None
+ path.linewidth = self.tickwidth
+ path.antialiased = False
+
+ self.pathids.add(self.figure.add_path(path))
+
+ 
+ xmin, xmax = self.viewlim
+
+ # the axis line
+ codes = []
+ verts = []
+ codes.append(Path.MOVETO)
+ verts.append((xmin, yloc))
+ codes.append(Path.LINETO)
+ verts.append((xmax, yloc))
+
+ path = Path()
+ path.verts = npy.array(verts)
+ path.codes = npy.array(codes)
+ path.strokecolor = self.axiscolor
+ path.fillcolor = None
+ path.antialiased = False
+ 
+ self.pathids.add(self.figure.add_path(path))
+
+ 
+class YAxis:
+ def __init__(self, figure):
+ Axis.__init__(self, figure)
+
+ def set_ticks(self, xloc, xsize, ticks, fmt):
+
+ for pathid in self.pathids:
+ self.figure.remove_path(pathid)
+
+ codes = []
+ verts = []
+ tickmin = yloc-ysize/2.
+ tickmax = yloc+ysize/2.
+ for tick in ticks:
+ codes.append(Path.MOVETO)
+ verts.append((tickmin, tick))
+ codes.append(Path.LINETO)
+ verts.append((tickmax, tick))
+ 
+
+ self.tickpath = path = Path()
+ path.verts = npy.array(verts)
+ path.codes = npy.array(codes)
+ path.strokecolor = self.tickcolor
+ path.fillcolor = None
+ path.linewidth = self.tickwidth
+ path.antialiased = False
+
+ self.pathids.add(self.figure.add_path(path))
+
+ 
+ ymin, ymax = self.viewlim
+
+ # the axis line
+ codes = []
+ verts = []
+ codes.append(Path.MOVETO)
+ verts.append((xloc, ymin))
+ codes.append(Path.LINETO)
+ verts.append((xloc, ymax))
+
+ self.axispath = path = Path()
+ path.verts = npy.array(verts)
+ path.codes = npy.array(codes)
+ path.strokecolor = self.axiscolor
+ path.fillcolor = None
+ path.antialiased = False
+ 
+ self.pathids.add(self.figure.add_path(path))
+
+
+
+
+
+
+if 0:
+ ax1.set_ylim(-1.1, 1.1)
+
+ xaxis = XAxis(ax1)
+ xaxis.set_ticks(0, 0.1, npy.arange(11.0), '%d')
+
+ yaxis1 = YAxis(ax1)
+ yaxis1.set_ticks(-1.1, 0.2, npy.arange(-1.0, 1.1, 0.5), '%d')
+ yaxis1.axiscolor = line1.color
+
+ yaxis2 = YAxis(ax1)
+ yaxis2.set_ticks(5.0, 0.2, npy.arange(-1.0, 1.1, 0.5), '%d')
+
+
+
+
+
+ theta = 0.25*npy.pi # 45 degree axes rotation
+ #rotate_axes(ax1, theta)
+
+
+ r = npy.arange(0, 1, 0.01)
+ theta = r*4*npy.pi
+ X2 = npy.array([r,theta]).T
+ line2 = Line(X2, model=Polar())
+ ax2.add_line(line2)
+ # currently cartesian
+ ax2.set_xlim(-1,1)
+ ax2.set_ylim(-1,1)
Added: trunk/matplotlib/mpl1/test.py
===================================================================
--- trunk/matplotlib/mpl1/test.py	 (rev 0)
+++ trunk/matplotlib/mpl1/test.py	2007年07月18日 21:30:12 UTC (rev 3567)
@@ -0,0 +1,15 @@
+import numpy
+from enthought.traits.api import HasTraits, Array
+import mtraits
+
+
+class Path(HasTraits):
+ """
+ The path is an object that talks to the backends, and is an
+ intermediary between the high level path artists like Line and
+ Polygon, and the backend renderer
+ """
+ strokecolor = mtraits.color('white')
+
+p = Path()
+print 'strokecolor', p.strokecolor
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2007年07月18日 20:38:34
Revision: 3566
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3566&view=rev
Author: jdh2358
Date: 2007年07月18日 13:38:32 -0700 (2007年7月18日)
Log Message:
-----------
added mpl1 sketch
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/agg.py
 trunk/matplotlib/lib/matplotlib/axes.py
 trunk/matplotlib/makeswig.py
 trunk/matplotlib/src/agg.cxx
 trunk/matplotlib/src/swig_runtime.h
 trunk/matplotlib/swig/agg.i
Added Paths:
-----------
 trunk/matplotlib/mpl1/
 trunk/matplotlib/mpl1/mpl1.py
 trunk/matplotlib/mpl1/mtraits.py
Modified: trunk/matplotlib/lib/matplotlib/agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/agg.py	2007年07月18日 17:21:11 UTC (rev 3565)
+++ trunk/matplotlib/lib/matplotlib/agg.py	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -1,10 +1,16 @@
-# This file was created automatically by SWIG 1.3.30.
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.31
+#
 # Don't modify this file, modify the SWIG interface instead.
 # This file is compatible with both classic and new-style classes.
 
 import _agg
 import new
 new_instancemethod = new.instancemethod
+try:
+ _swig_property = property
+except NameError:
+ pass # Python < 2.2 doesn't have 'property'.
 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
 if (name == "thisown"): return self.this.own(value)
 if (name == "this"):
@@ -90,11 +96,11 @@
 __repr__ = _swig_repr
 __swig_setmethods__["x"] = _agg.point_type_x_set
 __swig_getmethods__["x"] = _agg.point_type_x_get
- if _newclass:x = property(_agg.point_type_x_get, _agg.point_type_x_set)
+ if _newclass:x = _swig_property(_agg.point_type_x_get, _agg.point_type_x_set)
 __swig_setmethods__["y"] = _agg.point_type_y_set
 __swig_getmethods__["y"] = _agg.point_type_y_get
- if _newclass:y = property(_agg.point_type_y_get, _agg.point_type_y_set)
- def __init__(self, *args):
+ if _newclass:y = _swig_property(_agg.point_type_y_get, _agg.point_type_y_set)
+ def __init__(self, *args): 
 this = _agg.new_point_type(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -113,14 +119,14 @@
 __repr__ = _swig_repr
 __swig_setmethods__["x"] = _agg.vertex_type_x_set
 __swig_getmethods__["x"] = _agg.vertex_type_x_get
- if _newclass:x = property(_agg.vertex_type_x_get, _agg.vertex_type_x_set)
+ if _newclass:x = _swig_property(_agg.vertex_type_x_get, _agg.vertex_type_x_set)
 __swig_setmethods__["y"] = _agg.vertex_type_y_set
 __swig_getmethods__["y"] = _agg.vertex_type_y_get
- if _newclass:y = property(_agg.vertex_type_y_get, _agg.vertex_type_y_set)
+ if _newclass:y = _swig_property(_agg.vertex_type_y_get, _agg.vertex_type_y_set)
 __swig_setmethods__["cmd"] = _agg.vertex_type_cmd_set
 __swig_getmethods__["cmd"] = _agg.vertex_type_cmd_get
- if _newclass:cmd = property(_agg.vertex_type_cmd_get, _agg.vertex_type_cmd_set)
- def __init__(self, *args):
+ if _newclass:cmd = _swig_property(_agg.vertex_type_cmd_get, _agg.vertex_type_cmd_set)
+ def __init__(self, *args): 
 this = _agg.new_vertex_type(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -137,17 +143,17 @@
 __repr__ = _swig_repr
 __swig_setmethods__["x1"] = _agg.rect_x1_set
 __swig_getmethods__["x1"] = _agg.rect_x1_get
- if _newclass:x1 = property(_agg.rect_x1_get, _agg.rect_x1_set)
+ if _newclass:x1 = _swig_property(_agg.rect_x1_get, _agg.rect_x1_set)
 __swig_setmethods__["y1"] = _agg.rect_y1_set
 __swig_getmethods__["y1"] = _agg.rect_y1_get
- if _newclass:y1 = property(_agg.rect_y1_get, _agg.rect_y1_set)
+ if _newclass:y1 = _swig_property(_agg.rect_y1_get, _agg.rect_y1_set)
 __swig_setmethods__["x2"] = _agg.rect_x2_set
 __swig_getmethods__["x2"] = _agg.rect_x2_get
- if _newclass:x2 = property(_agg.rect_x2_get, _agg.rect_x2_set)
+ if _newclass:x2 = _swig_property(_agg.rect_x2_get, _agg.rect_x2_set)
 __swig_setmethods__["y2"] = _agg.rect_y2_set
 __swig_getmethods__["y2"] = _agg.rect_y2_get
- if _newclass:y2 = property(_agg.rect_y2_get, _agg.rect_y2_set)
- def __init__(self, *args):
+ if _newclass:y2 = _swig_property(_agg.rect_y2_get, _agg.rect_y2_set)
+ def __init__(self, *args): 
 this = _agg.new_rect(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -167,17 +173,17 @@
 __repr__ = _swig_repr
 __swig_setmethods__["x1"] = _agg.rect_d_x1_set
 __swig_getmethods__["x1"] = _agg.rect_d_x1_get
- if _newclass:x1 = property(_agg.rect_d_x1_get, _agg.rect_d_x1_set)
+ if _newclass:x1 = _swig_property(_agg.rect_d_x1_get, _agg.rect_d_x1_set)
 __swig_setmethods__["y1"] = _agg.rect_d_y1_set
 __swig_getmethods__["y1"] = _agg.rect_d_y1_get
- if _newclass:y1 = property(_agg.rect_d_y1_get, _agg.rect_d_y1_set)
+ if _newclass:y1 = _swig_property(_agg.rect_d_y1_get, _agg.rect_d_y1_set)
 __swig_setmethods__["x2"] = _agg.rect_d_x2_set
 __swig_getmethods__["x2"] = _agg.rect_d_x2_get
- if _newclass:x2 = property(_agg.rect_d_x2_get, _agg.rect_d_x2_set)
+ if _newclass:x2 = _swig_property(_agg.rect_d_x2_get, _agg.rect_d_x2_set)
 __swig_setmethods__["y2"] = _agg.rect_d_y2_set
 __swig_getmethods__["y2"] = _agg.rect_d_y2_get
- if _newclass:y2 = property(_agg.rect_d_y2_get, _agg.rect_d_y2_set)
- def __init__(self, *args):
+ if _newclass:y2 = _swig_property(_agg.rect_d_y2_get, _agg.rect_d_y2_set)
+ def __init__(self, *args): 
 this = _agg.new_rect_d(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -201,11 +207,11 @@
 __repr__ = _swig_repr
 __swig_setmethods__["size"] = _agg.binary_data_size_set
 __swig_getmethods__["size"] = _agg.binary_data_size_get
- if _newclass:size = property(_agg.binary_data_size_get, _agg.binary_data_size_set)
+ if _newclass:size = _swig_property(_agg.binary_data_size_get, _agg.binary_data_size_set)
 __swig_setmethods__["data"] = _agg.binary_data_data_set
 __swig_getmethods__["data"] = _agg.binary_data_data_get
- if _newclass:data = property(_agg.binary_data_data_get, _agg.binary_data_data_set)
- def __init__(self, *args):
+ if _newclass:data = _swig_property(_agg.binary_data_data_get, _agg.binary_data_data_set)
+ def __init__(self, *args): 
 this = _agg.new_binary_data(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -220,7 +226,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, buffer, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_buffer(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -228,17 +234,17 @@
 __del__ = lambda self : None;
 def to_string(*args): return _agg.buffer_to_string(*args)
 __swig_getmethods__["width"] = _agg.buffer_width_get
- if _newclass:width = property(_agg.buffer_width_get)
+ if _newclass:width = _swig_property(_agg.buffer_width_get)
 __swig_getmethods__["height"] = _agg.buffer_height_get
- if _newclass:height = property(_agg.buffer_height_get)
+ if _newclass:height = _swig_property(_agg.buffer_height_get)
 __swig_getmethods__["stride"] = _agg.buffer_stride_get
- if _newclass:stride = property(_agg.buffer_stride_get)
+ if _newclass:stride = _swig_property(_agg.buffer_stride_get)
 __swig_setmethods__["data"] = _agg.buffer_data_set
 __swig_getmethods__["data"] = _agg.buffer_data_get
- if _newclass:data = property(_agg.buffer_data_get, _agg.buffer_data_set)
+ if _newclass:data = _swig_property(_agg.buffer_data_get, _agg.buffer_data_set)
 __swig_setmethods__["freemem"] = _agg.buffer_freemem_set
 __swig_getmethods__["freemem"] = _agg.buffer_freemem_get
- if _newclass:freemem = property(_agg.buffer_freemem_get, _agg.buffer_freemem_set)
+ if _newclass:freemem = _swig_property(_agg.buffer_freemem_get, _agg.buffer_freemem_set)
 buffer_swigregister = _agg.buffer_swigregister
 buffer_swigregister(buffer)
 
@@ -252,7 +258,7 @@
 G = _agg.order_rgb_G
 B = _agg.order_rgb_B
 rgb_tag = _agg.order_rgb_rgb_tag
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_order_rgb(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -271,7 +277,7 @@
 G = _agg.order_bgr_G
 R = _agg.order_bgr_R
 rgb_tag = _agg.order_bgr_rgb_tag
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_order_bgr(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -291,7 +297,7 @@
 B = _agg.order_rgba_B
 A = _agg.order_rgba_A
 rgba_tag = _agg.order_rgba_rgba_tag
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_order_rgba(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -311,7 +317,7 @@
 G = _agg.order_argb_G
 B = _agg.order_argb_B
 rgba_tag = _agg.order_argb_rgba_tag
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_order_argb(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -331,7 +337,7 @@
 G = _agg.order_abgr_G
 R = _agg.order_abgr_R
 rgba_tag = _agg.order_abgr_rgba_tag
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_order_abgr(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -351,7 +357,7 @@
 R = _agg.order_bgra_R
 A = _agg.order_bgra_A
 rgba_tag = _agg.order_bgra_rgba_tag
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_order_bgra(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -368,16 +374,16 @@
 __repr__ = _swig_repr
 __swig_setmethods__["r"] = _agg.rgba_r_set
 __swig_getmethods__["r"] = _agg.rgba_r_get
- if _newclass:r = property(_agg.rgba_r_get, _agg.rgba_r_set)
+ if _newclass:r = _swig_property(_agg.rgba_r_get, _agg.rgba_r_set)
 __swig_setmethods__["g"] = _agg.rgba_g_set
 __swig_getmethods__["g"] = _agg.rgba_g_get
- if _newclass:g = property(_agg.rgba_g_get, _agg.rgba_g_set)
+ if _newclass:g = _swig_property(_agg.rgba_g_get, _agg.rgba_g_set)
 __swig_setmethods__["b"] = _agg.rgba_b_set
 __swig_getmethods__["b"] = _agg.rgba_b_get
- if _newclass:b = property(_agg.rgba_b_get, _agg.rgba_b_set)
+ if _newclass:b = _swig_property(_agg.rgba_b_get, _agg.rgba_b_set)
 __swig_setmethods__["a"] = _agg.rgba_a_set
 __swig_getmethods__["a"] = _agg.rgba_a_get
- if _newclass:a = property(_agg.rgba_a_get, _agg.rgba_a_set)
+ if _newclass:a = _swig_property(_agg.rgba_a_get, _agg.rgba_a_set)
 def clear(*args): return _agg.rgba_clear(*args)
 def transparent(*args): return _agg.rgba_transparent(*args)
 def opacity(*args): return _agg.rgba_opacity(*args)
@@ -388,7 +394,7 @@
 if _newclass:no_color = staticmethod(_agg.rgba_no_color)
 __swig_getmethods__["from_wavelength"] = lambda x: _agg.rgba_from_wavelength
 if _newclass:from_wavelength = staticmethod(_agg.rgba_from_wavelength)
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_rgba(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -410,17 +416,17 @@
 base_mask = _agg.rgba8_base_mask
 __swig_setmethods__["r"] = _agg.rgba8_r_set
 __swig_getmethods__["r"] = _agg.rgba8_r_get
- if _newclass:r = property(_agg.rgba8_r_get, _agg.rgba8_r_set)
+ if _newclass:r = _swig_property(_agg.rgba8_r_get, _agg.rgba8_r_set)
 __swig_setmethods__["g"] = _agg.rgba8_g_set
 __swig_getmethods__["g"] = _agg.rgba8_g_get
- if _newclass:g = property(_agg.rgba8_g_get, _agg.rgba8_g_set)
+ if _newclass:g = _swig_property(_agg.rgba8_g_get, _agg.rgba8_g_set)
 __swig_setmethods__["b"] = _agg.rgba8_b_set
 __swig_getmethods__["b"] = _agg.rgba8_b_get
- if _newclass:b = property(_agg.rgba8_b_get, _agg.rgba8_b_set)
+ if _newclass:b = _swig_property(_agg.rgba8_b_get, _agg.rgba8_b_set)
 __swig_setmethods__["a"] = _agg.rgba8_a_set
 __swig_getmethods__["a"] = _agg.rgba8_a_get
- if _newclass:a = property(_agg.rgba8_a_get, _agg.rgba8_a_set)
- def __init__(self, *args):
+ if _newclass:a = _swig_property(_agg.rgba8_a_get, _agg.rgba8_a_set)
+ def __init__(self, *args): 
 this = _agg.new_rgba8(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -456,17 +462,17 @@
 base_mask = _agg.rgba16_base_mask
 __swig_setmethods__["r"] = _agg.rgba16_r_set
 __swig_getmethods__["r"] = _agg.rgba16_r_get
- if _newclass:r = property(_agg.rgba16_r_get, _agg.rgba16_r_set)
+ if _newclass:r = _swig_property(_agg.rgba16_r_get, _agg.rgba16_r_set)
 __swig_setmethods__["g"] = _agg.rgba16_g_set
 __swig_getmethods__["g"] = _agg.rgba16_g_get
- if _newclass:g = property(_agg.rgba16_g_get, _agg.rgba16_g_set)
+ if _newclass:g = _swig_property(_agg.rgba16_g_get, _agg.rgba16_g_set)
 __swig_setmethods__["b"] = _agg.rgba16_b_set
 __swig_getmethods__["b"] = _agg.rgba16_b_get
- if _newclass:b = property(_agg.rgba16_b_get, _agg.rgba16_b_set)
+ if _newclass:b = _swig_property(_agg.rgba16_b_get, _agg.rgba16_b_set)
 __swig_setmethods__["a"] = _agg.rgba16_a_set
 __swig_getmethods__["a"] = _agg.rgba16_a_get
- if _newclass:a = property(_agg.rgba16_a_get, _agg.rgba16_a_set)
- def __init__(self, *args):
+ if _newclass:a = _swig_property(_agg.rgba16_a_get, _agg.rgba16_a_set)
+ def __init__(self, *args): 
 this = _agg.new_rgba16(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -494,7 +500,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, trans_affine, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_trans_affine(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -531,13 +537,13 @@
 
 class trans_affine_rotation(trans_affine):
 __swig_setmethods__ = {}
- for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
 __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_rotation, name, value)
 __swig_getmethods__ = {}
- for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
 __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_rotation, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_trans_affine_rotation(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -548,13 +554,13 @@
 
 class trans_affine_scaling(trans_affine):
 __swig_setmethods__ = {}
- for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
 __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_scaling, name, value)
 __swig_getmethods__ = {}
- for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
 __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_scaling, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_trans_affine_scaling(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -565,13 +571,13 @@
 
 class trans_affine_translation(trans_affine):
 __swig_setmethods__ = {}
- for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
 __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_translation, name, value)
 __swig_getmethods__ = {}
- for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
 __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_translation, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_trans_affine_translation(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -582,13 +588,13 @@
 
 class trans_affine_skewing(trans_affine):
 __swig_setmethods__ = {}
- for _s in [trans_affine]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [trans_affine]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
 __setattr__ = lambda self, name, value: _swig_setattr(self, trans_affine_skewing, name, value)
 __swig_getmethods__ = {}
- for _s in [trans_affine]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [trans_affine]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
 __getattr__ = lambda self, name: _swig_getattr(self, trans_affine_skewing, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_trans_affine_skewing(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -605,7 +611,7 @@
 __repr__ = _swig_repr
 __swig_destroy__ = _agg.delete_path_storage
 __del__ = lambda self : None;
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_path_storage(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -657,7 +663,7 @@
 __repr__ = _swig_repr
 __swig_destroy__ = _agg.delete_rendering_buffer
 __del__ = lambda self : None;
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_rendering_buffer(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -712,8 +718,8 @@
 __repr__ = _swig_repr
 __swig_setmethods__["c"] = _agg.pixel64_type_c_set
 __swig_getmethods__["c"] = _agg.pixel64_type_c_get
- if _newclass:c = property(_agg.pixel64_type_c_get, _agg.pixel64_type_c_set)
- def __init__(self, *args):
+ if _newclass:c = _swig_property(_agg.pixel64_type_c_get, _agg.pixel64_type_c_set)
+ def __init__(self, *args): 
 this = _agg.new_pixel64_type(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -731,7 +737,7 @@
 base_shift = _agg.pixel_format_rgba_base_shift
 base_size = _agg.pixel_format_rgba_base_size
 base_mask = _agg.pixel_format_rgba_base_mask
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_pixel_format_rgba(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -766,7 +772,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, renderer_base_rgba, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_renderer_base_rgba(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -823,7 +829,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_curve_path, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_curve_path(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -842,7 +848,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_curve_trans, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_curve_trans(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -861,7 +867,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_transform_path, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_transform_path(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -880,7 +886,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_transform_curve, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_transform_curve(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -899,7 +905,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, vcgen_stroke, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_vcgen_stroke(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -932,7 +938,7 @@
 def prepare_src(*args): return _agg.null_markers_prepare_src(*args)
 def rewind(*args): return _agg.null_markers_rewind(*args)
 def vertex(*args): return _agg.null_markers_vertex(*args)
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_null_markers(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -947,7 +953,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_path, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_adaptor_vcgen_path(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -967,7 +973,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_transpath, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_adaptor_vcgen_transpath(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -987,7 +993,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_curve, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_adaptor_vcgen_curve(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1007,7 +1013,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_transcurve, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_adaptor_vcgen_transcurve(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1027,7 +1033,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_adaptor_vcgen_curvetrans, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_adaptor_vcgen_curvetrans(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1043,13 +1049,13 @@
 
 class conv_stroke_path(conv_adaptor_vcgen_path):
 __swig_setmethods__ = {}
- for _s in [conv_adaptor_vcgen_path]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [conv_adaptor_vcgen_path]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
 __setattr__ = lambda self, name, value: _swig_setattr(self, conv_stroke_path, name, value)
 __swig_getmethods__ = {}
- for _s in [conv_adaptor_vcgen_path]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [conv_adaptor_vcgen_path]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
 __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_path, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_stroke_path(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1069,13 +1075,13 @@
 
 class conv_stroke_transpath(conv_adaptor_vcgen_transpath):
 __swig_setmethods__ = {}
- for _s in [conv_adaptor_vcgen_transpath]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [conv_adaptor_vcgen_transpath]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
 __setattr__ = lambda self, name, value: _swig_setattr(self, conv_stroke_transpath, name, value)
 __swig_getmethods__ = {}
- for _s in [conv_adaptor_vcgen_transpath]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [conv_adaptor_vcgen_transpath]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
 __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_transpath, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_stroke_transpath(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1095,13 +1101,13 @@
 
 class conv_stroke_curve(conv_adaptor_vcgen_curve):
 __swig_setmethods__ = {}
- for _s in [conv_adaptor_vcgen_curve]: __swig_setmethods__.update(_s.__swig_setmethods__)
+ for _s in [conv_adaptor_vcgen_curve]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
 __setattr__ = lambda self, name, value: _swig_setattr(self, conv_stroke_curve, name, value)
 __swig_getmethods__ = {}
- for _s in [conv_adaptor_vcgen_curve]: __swig_getmethods__.update(_s.__swig_getmethods__)
+ for _s in [conv_adaptor_vcgen_curve]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
 __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_curve, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_stroke_curve(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1125,7 +1131,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_transcurve, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_stroke_transcurve(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1149,7 +1155,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, conv_stroke_curvetrans, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_conv_stroke_curvetrans(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1173,7 +1179,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, rasterizer_scanline_aa, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_rasterizer_scanline_aa(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1208,7 +1214,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, renderer_scanline_aa_solid_rgba, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_renderer_scanline_aa_solid_rgba(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1228,7 +1234,7 @@
 __swig_getmethods__ = {}
 __getattr__ = lambda self, name: _swig_getattr(self, renderer_scanline_bin_solid_rgba, name)
 __repr__ = _swig_repr
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_renderer_scanline_bin_solid_rgba(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1250,7 +1256,7 @@
 __repr__ = _swig_repr
 __swig_destroy__ = _agg.delete_scanline_p8
 __del__ = lambda self : None;
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_scanline_p8(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1274,7 +1280,7 @@
 __repr__ = _swig_repr
 __swig_destroy__ = _agg.delete_scanline_bin
 __del__ = lambda self : None;
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_scanline_bin(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1297,7 +1303,7 @@
 __repr__ = _swig_repr
 __swig_destroy__ = _agg.delete_scanline32_bin
 __del__ = lambda self : None;
- def __init__(self, *args):
+ def __init__(self, *args): 
 this = _agg.new_scanline32_bin(*args)
 try: self.this.append(this)
 except: self.this = this
@@ -1313,5 +1319,6 @@
 scanline32_bin_swigregister(scanline32_bin)
 
 render_scanlines_rgba = _agg.render_scanlines_rgba
+render_scanlines_bin_rgba = _agg.render_scanlines_bin_rgba
 
 
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py	2007年07月18日 17:21:11 UTC (rev 3565)
+++ trunk/matplotlib/lib/matplotlib/axes.py	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -5820,7 +5820,8 @@
 """
 # this is some discarded code I was using to find the minimum positive
 # data point for some log scaling fixes. I realized there was a
-# cleaner way to do it, but am keeping this around as an example for
+# cleaner way to do it, but am ke
+eping this around as an example for
 # how to get the data out of the axes. Might want to make something
 # like this a method one day, or better yet make get_verts and Artist
 # method
Modified: trunk/matplotlib/makeswig.py
===================================================================
--- trunk/matplotlib/makeswig.py	2007年07月18日 17:21:11 UTC (rev 3565)
+++ trunk/matplotlib/makeswig.py	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -6,7 +6,7 @@
 'agg',
 )
 #SWIG = 'swig'
-SWIG = '/home/jdhunter/local/bin/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 '
Added: trunk/matplotlib/mpl1/mpl1.py
===================================================================
--- trunk/matplotlib/mpl1/mpl1.py	 (rev 0)
+++ trunk/matplotlib/mpl1/mpl1.py	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -0,0 +1,421 @@
+from matplotlib.enthought.traits import HasTraits
+import matplotlib.enthought.traits as traits
+
+from matplotlib import agg
+import numpy as npy
+
+import mtraits # some handy traits for mpl
+
+class Func:
+ def __call__(self, X):
+ 'transform the numpy array with shape N,2'
+ raise NotImplementedError
+ 
+ def invert(self, x, y):
+ 'invert the point x, y'
+ raise NotImplementedError
+
+ def point(self, x, y):
+ 'transform the point x, y'
+ raise NotImplementedError
+
+class Identity(Func):
+ def __call__(self, X):
+ 'transform the numpy array with shape N,2'
+ return X
+ 
+ def invert(self, x, y):
+ 'invert the point x, y'
+ return x, y
+
+ def point(self, x, y):
+ 'transform the point x, y'
+ return x, y
+
+
+class Polar(Func):
+ def __call__(self, X):
+ 'transform the numpy array with shape N,2'
+ r = X[:,0]
+ theta = X[:,1]
+ x = r*npy.cos(theta)
+ y = r*npy.sin(theta)
+ return npy.array([x,y]).T
+ 
+ def invert(self, x, y):
+ 'invert the point x, y'
+ raise NotImplementedError
+
+ def point(self, x, y):
+ 'transform the point x, y'
+ raise NotImplementedError
+
+ 
+identity = Identity()
+
+
+class Path(HasTraits):
+ """
+ The path is an object that talks to the backends, and is an
+ intermediary between the high level path artists like Line and
+ Polygon, and the backend renderer
+ """
+ MOVETO, LINETO, CLOSEPOLY = range(3)
+ 
+ strokecolor = mtraits.color('black')
+ fillcolor = mtraits.color('blue')
+ alpha = mtraits.alpha(1.0)
+ linewidth = mtraits.linewidth(1.0)
+ antialiased = mtraits.flexible_true_trait
+ verts= mtraits.verts
+ codes = mtraits.codes
+
+mtraits.path = traits.Trait(Path())
+ 
+class AggPath:
+ def __init__(self, path):
+ """
+ Path stored with agg data structs 
+ """
+ MOVETO, LINETO, CLOSEPOLY = Path.MOVETO, Path.LINETO, Path.CLOSEPOLY
+ aggpath = agg.path_storage()
+ verts = path.verts
+ codes = path.codes
+ for i in range(len(verts)):
+ x, y = verts[i]
+ code = codes[i]
+ if code==MOVETO:
+ aggpath.move_to(x, y)
+ elif code==LINETO:
+ aggpath.line_to(x, y) 
+ elif code==CLOSEPOLY:
+ aggpath.close_polygon()
+
+ self.fillcolor = self.color_to_rgba8(path.fillcolor)
+ self.strokecolor = self.color_to_rgba8(path.strokecolor)
+
+ self.aggpath = aggpath
+ self.alpha = float(path.alpha)
+ self.linewidth = float(path.linewidth)
+ self.antialiased = bool(path.antialiased)
+
+ def color_to_rgba8(self, color):
+ if color is None: return None
+ rgba = [int(255*c) for c in color.r, color.g, color.b, color.a]
+ return agg.rgba8(*rgba)
+
+# coordinates:
+#
+# artist model : a possibly nonlinear transformation (Func instance)
+# to a separable cartesian coordinate, eg for polar is takes r,
+# theta -> r*cos(theta), r*sin(theta)
+#
+# affineData : an affine 3x3 matrix that takes model output and
+# transforms it to axes 0,1. We are kind of stuck with the
+# mpl/matlab convention that 0,0 is the bottom left of the axes,
+# even though it contradicts pretty much every GUI layout in the
+# world
+#
+# affineFigure: an affine 3x3 that transforms an axes.view into figure
+# 0,1 
+#
+# affineDisplay : takes an affine 3x3 and puts figure view into display. 0,
+# 0 is left, top, which is the typical coordinate system of most
+# graphics formats
+
+class Renderer:
+ def __init__(self, width, height):
+ self.width, self.height = width, height
+
+ # almost all renderers assume 0,0 is left, upper, so we'll flip y here by default
+ self.displayview = npy.array(
+ [[width, 0, 0], [0, -height, height], [0, 0, 1]], dtype=npy.float_)
+ self.pathd = dict() # dict mapping path id -> path instance
+ 
+ def push_affine(self, affine):
+ 'set the current affine'
+ self.affine = npy.dot(self.displayview, affine)
+
+ def add_path(self, pathid, path):
+ self.pathd[pathid] = path
+
+ def remove_path(self, pathid):
+ if pathid in self.pathd:
+ del self.pathd[pathid]
+
+ def render_path(self, pathid):
+ pass
+ 
+
+
+class RendererAgg(Renderer):
+ gray = agg.rgba8(128,128,128,255) 
+ white = agg.rgba8(255,255,255,255)
+ blue = agg.rgba8(0,0,255,255)
+
+ def __init__(self, width, height):
+ Renderer.__init__(self, width, height)
+
+ self.aggpathd = dict() # map path ids to AggPaths
+ stride = width*4
+ self.buf = buf = agg.buffer(width, height, stride)
+
+ self.rbuf = rbuf = agg.rendering_buffer()
+ rbuf.attachb(buf)
+
+ self.pf = pf = agg.pixel_format_rgba(rbuf)
+ self.rbase = rbase = agg.renderer_base_rgba(pf)
+ rbase.clear_rgba8(self.gray)
+
+ # the antialiased renderers
+ self.renderer = agg.renderer_scanline_aa_solid_rgba(rbase); 
+ self.rasterizer = agg.rasterizer_scanline_aa()
+ self.scanline = agg.scanline_p8()
+ self.trans = None
+
+ # the aliased renderers
+ self.rendererbin = agg.renderer_scanline_bin_solid_rgba(rbase);
+ self.scanlinebin = agg.scanline_bin()
+
+ def add_path(self, pathid, path):
+ pathid = Renderer.add_path(self, pathid, path)
+ self.aggpathd[pathid] = AggPath(path)
+
+ def remove_path(self, pathid):
+ Renderer.remove_path(self, pathid)
+ if pathid in self.aggpathd:
+ del self.aggpathd[pathid]
+
+ def push_affine(self, affine):
+ 'set the current affine'
+ Renderer.push_affine(self, affine)
+ a, b, tx = self.affine[0]
+ c, d, ty = self.affine[1]
+ self.trans = agg.trans_affine(a,b,c,d,tx,ty)
+
+
+ def render_path(self, pathid):
+ if self.trans is None:
+ raise RuntimeError('you must first push_affine')
+
+
+
+ aggpath = self.aggpathd[pathid]
+
+ if aggpath.antialiased:
+ renderer = self.renderer
+ scanline = self.scanline
+ render_scanlines = agg.render_scanlines_rgba
+ else:
+ renderer = self.rendererbin
+ scanline = self.scanlinebin
+ render_scanlines = agg.render_scanlines_bin_rgba
+
+ renderer.color_rgba8( aggpath.strokecolor )
+ transpath = agg.conv_transform_path(aggpath.aggpath, self.trans)
+
+ if aggpath.fillcolor is not None:
+ self.rasterizer.add_path(transpath)
+ renderer.color_rgba8( aggpath.fillcolor )
+ render_scanlines(self.rasterizer, scanline, renderer);
+ 
+ stroke = agg.conv_stroke_transpath(transpath)
+ stroke.width(aggpath.linewidth)
+ self.rasterizer.add_path(stroke)
+ renderer.color_rgba8( aggpath.strokecolor ) 
+ render_scanlines(self.rasterizer, scanline, renderer);
+
+
+ def show(self):
+ # we'll cheat a little and use pylab for display
+
+ X = npy.fromstring(self.buf.to_string(), npy.uint8)
+ X.shape = self.height, self.width, 4
+ if 1:
+ import pylab
+ fig = pylab.figure()
+ ax = fig.add_axes([0,0,1,1], xticks=[], yticks=[],
+ frameon=False, aspect='auto')
+ ax.imshow(X, aspect='auto')
+ pylab.show()
+
+
+
+
+
+def rectangle(l, b, w, h, facecolor='yellow', edgecolor='black',
+ edgewidth=1.0, alpha=1.0):
+
+ t = b+h
+ r = l+w
+ verts = npy.array([(l,b), (l,t), (r, t), (r, b), (0,0)], npy.float_)
+ codes = Path.LINETO*npy.ones(5, npy.uint8)
+ codes[0] = Path.MOVETO
+ codes[-1] = Path.CLOSEPOLY
+
+ path = Path()
+ part.verts = verts
+ path.codes = codes
+ path.strokecolor = edgecolor
+ path.fillcolor = facecolor
+ path.linewidth = edgewidth
+ path.alpha = alpha
+ return path
+
+def line(x, y, color='black', linewidth=1.0, alpha=1.0, antialiased=True,
+ model=identity):
+ X = npy.asarray([x,y]).T
+ numrows, numcols = X.shape
+
+ codes = Path.LINETO*npy.ones(numrows, npy.uint8)
+ codes[0] = Path.MOVETO
+
+ path = Path()
+ path.verts = model(X)
+ path.codes = codes 
+ path.fillcolor = None
+ path.strokewidth = linewidth
+ path.alpha = alpha
+ path.antialiased = antialiased
+ return path
+ 
+ 
+
+class AxesCoords(HasTraits):
+ xviewlim = mtraits.interval
+ yviewlim = mtraits.interval
+ affineview = mtraits.affine
+ affineaxes = mtraits.affine 
+ affine = mtraits.affine 
+
+ def _affineview_changed(self, old, new):
+ self.affine = npy.dot(
+ npy.dot(self.affineaxes, new), self.affinedata)
+
+ def _affineaxes_changed(self, old, new):
+ self.affine = npy.dot(
+ npy.dot(new, self.affineview), self.affinedata)
+
+
+ def _xviewlim_changed(self, old, new):
+ xmin, xmax = new
+ scale = 1./(xmax-xmin)
+ tx = -xmin*scale
+ self.affineview[0][0] = scale
+ self.affineview[0][-1] = tx
+
+ def _yviewlim_changed(self, old, new):
+ ymin, ymax = new
+ scale = 1./(ymax-ymin)
+ ty = -ymin*scale
+ self.affineview[1][1] = scale
+ self.affineview[1][-1] = ty
+
+ 
+
+class Figure:
+ def __init__(self):
+ self.renderer = None
+ self._pathid = 0
+ self._pathd = dict()
+
+ def add_path(self, path):
+ id_ = self._pathid
+ self.pathd[id_] = path
+ self._pathid += 1
+ return id_
+
+ def remove_path(self, pathid):
+ if pathid in self.pathd: 
+ del self.pathd[pathid]
+ if self.renderer is not None:
+ self.renderer.remove_path(pathid)
+ 
+ def draw(self):
+ if self.renderer is None:
+ raise RuntimeError('call set_renderer renderer first')
+
+ for pathid, path in self.pathd.items():
+ renderer.push_affine(path.affine)
+ renderer.render_path(pathid)
+
+ 
+ def set_renderer(self, renderer):
+ self.renderer = renderer
+ for pathid, path in self.pathd.items():
+ renderer.add_path(pathid, path)
+
+
+def affine_axes(rect):
+ 'make an affine for a typical l,b,w,h axes rectangle'
+ l,b,w,h = rect
+ return npy.array([[w, 0, l], [0, h, b], [0, 0, 1]], dtype=npy.float_)
+
+def affine_identity():
+ return npy.array([[1,0,0],
+ [0,1,0],
+ [0,0,1]],
+ dtype=npy.float_)
+
+def affine_translation(tx, ty):
+ return npy.array([[1,0,tx],
+ [0,1,ty],
+ [0,0,1]],
+ dtype=npy.float_)
+
+def affine_rotation(theta):
+ a = npy.cos(theta)
+ b = -npy.sin(theta)
+ c = npy.sin(theta)
+ d = npy.cos(theta)
+ 
+ return npy.array([[a,b,0],
+ [c,d,0],
+ [0,0,1]],
+ dtype=npy.float_)
+
+xlim = mtraits.interval()
+ylim1 = mtraits.interval()
+ylim2 = mtraits.interval()
+
+affineaxes = affine_axes([0.1, 0.1, 0.4, 0.4]) # lower, left quadrant
+
+coords1 = AxesCoords()
+coords1.xlim = xlim
+coords1.ylim = ylim1
+print 'typedata', affineaxes.shape, affineaxes.dtype
+coords1.affineaxes = affineaxes
+
+coords2 = AxesCoords()
+coords2.xlim = xlim
+coords2.ylim = ylim2
+coords2.affineaxes = affineaxes
+
+
+
+fig = Figure()
+
+x = npy.arange(0, 10, 0.01)
+y1 = npy.cos(2*npy.pi*x)
+y2 = 10*npy.exp(-x)
+
+line1 = line(x, y1, color='blue', linewidth=2.0)
+line1.affine = coords1.affime
+
+line2 = line(x, y2, color='red', linewidth=2.0)
+line2.affine = coords1.affime
+
+fig.add_path(line1)
+fig.add_path(line2)
+
+# update the view limits, all the affines should be automagically updated
+xlim = 0,10
+ylim1 = -1.1, 1.1
+ylim2 = 0, 10
+
+
+renderer = RendererAgg(600,400)
+fig.set_renderer(renderer)
+fig.draw()
+print 'renderer affine', renderer.affine
+renderer.show()
Added: trunk/matplotlib/mpl1/mtraits.py
===================================================================
--- trunk/matplotlib/mpl1/mtraits.py	 (rev 0)
+++ trunk/matplotlib/mpl1/mtraits.py	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -0,0 +1,113 @@
+# Here is some example code showing how to define some representative
+# rc properties and construct a matplotlib artist using traits.
+# Because matplotlib ships with enthought traits already, you can run
+# this script with just matplotlib. Unfortunately, we do not ship the
+# ex UI component so you can't test that part. I'm a bit of a traits
+# newbie so there are probably better ways to do what I have done
+# below.
+
+import sys, os, re
+import matplotlib.enthought.traits as traits
+from matplotlib.cbook import is_string_like
+from matplotlib import colors as mcolors
+import numpy as npy
+
+doprint = True
+flexible_true_trait = traits.Trait(
+ True,
+ { 'true': True, 't': True, 'yes': True, 'y': True, 'on': True, True: True,
+ 'false': False, 'f': False, 'no': False, 'n': False, 'off': False, False: False
+ } )
+flexible_false_trait = traits.Trait( False, flexible_true_trait )
+
+colors = mcolors.cnames
+
+def hex2color(s):
+ "Convert hex string (like html uses, eg, #efefef) to a r,g,b tuple"
+ return tuple([int(n, 16)/255.0 for n in (s[1:3], s[3:5], s[5:7])])
+
+class RGBA(traits.HasTraits):
+ # r,g,b,a in the range 0-1 with default color 0,0,0,1 (black)
+ r = traits.Range(0., 1., 0.)
+ g = traits.Range(0., 1., 0.)
+ b = traits.Range(0., 1., 0.)
+ a = traits.Range(0., 1., 1.)
+ def __init__(self, r=0., g=0., b=0., a=1.):
+ self.r = r
+ self.g = g
+ self.b = b
+ self.a = a
+ def __repr__(self):
+ return 'r,g,b,a = (%1.2f, %1.2f, %1.2f, %1.2f)'%\
+ (self.r, self.g, self.b, self.a)
+
+def tuple_to_rgba(ob, name, val):
+ tup = [float(x) for x in val]
+ if len(tup)==3:
+ r,g,b = tup
+ return RGBA(r,g,b)
+ elif len(tup)==4:
+ r,g,b,a = tup
+ return RGBA(r,g,b,a)
+ else:
+ raise ValueError
+tuple_to_rgba.info = 'a RGB or RGBA tuple of floats'
+
+def hex_to_rgba(ob, name, val):
+ rgx = re.compile('^#[0-9A-Fa-f]{6}$')
+
+ if not is_string_like(val):
+ raise TypeError
+ if rgx.match(val) is None:
+ raise ValueError
+ r,g,b = hex2color(val)
+ return RGBA(r,g,b,1.0)
+hex_to_rgba.info = 'a hex color string'
+
+def colorname_to_rgba(ob, name, val):
+ hex = colors[val.lower()]
+ r,g,b = hex2color(hex)
+ return RGBA(r,g,b,1.0)
+colorname_to_rgba.info = 'a named color'
+
+def float_to_rgba(ob, name, val):
+ val = float(val)
+ return RGBA(val, val, val, 1.)
+float_to_rgba.info = 'a grayscale intensity'
+
+
+
+Color = traits.Trait(RGBA(), float_to_rgba, colorname_to_rgba, RGBA,
+ hex_to_rgba, tuple_to_rgba, None)
+
+def file_exists(ob, name, val):
+ fh = file(val, 'r')
+ return val
+
+def path_exists(ob, name, val):
+ os.path.exists(val)
+linestyles = ('-', '--', '-.', ':', 'steps', 'None')
+TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN = range(4)
+linemarkers = (None, '.', ',', 'o', '^', 'v', '<', '>', 's',
+ '+', 'x', 'd', 'D', '|', '_', 'h', 'H',
+ 'p', '1', '2', '3', '4',
+ TICKLEFT,
+ TICKRIGHT,
+ TICKUP,
+ TICKDOWN,
+ 'None')
+ 
+
+linewidth = traits.Float(0.5)
+linestyle = traits.Trait(*linestyles)
+color = Color
+marker = traits.Trait(*linemarkers)
+markersize = traits.Float(6)
+antialiased = flexible_true_trait
+alpha = traits.Range(0., 1., 0.)
+interval = traits.Array('d', (2,))
+affine = traits.Array('d', (3,3))
+verts = traits.Array('d')
+codes = traits.Array('b')
+
+
Modified: trunk/matplotlib/src/agg.cxx
===================================================================
--- trunk/matplotlib/src/agg.cxx	2007年07月18日 17:21:11 UTC (rev 3565)
+++ trunk/matplotlib/src/agg.cxx	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.30
+ * Version 1.3.31
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
@@ -795,11 +795,14 @@
 #endif
 
 /* Py_ssize_t for old Pythons */
-#if PY_VERSION_HEX < 0x02050000
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
 typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
 #endif
 
-
 /* -----------------------------------------------------------------------------
 * error manipulation
 * ----------------------------------------------------------------------------- */
@@ -2597,7 +2600,7 @@
 
 #if (PY_VERSION_HEX <= 0x02000000)
 # if !defined(SWIG_PYTHON_CLASSIC)
-# error "This python version requires to use swig with the '-classic' option"
+# error "This python version requires swig to be run with the '-classic' option"
 # endif
 #endif
 
@@ -2608,7 +2611,7 @@
 
 #define SWIG_name "_agg"
 
-#define SWIGVERSION 0x010330 
+#define SWIGVERSION 0x010331 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -30221,6 +30224,54 @@
 }
 
 
+SWIGINTERN PyObject *_wrap_render_scanlines_bin_rgba(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ agg::rasterizer_scanline_aa< > *arg1 = 0 ;
+ agg::scanline_bin *arg2 = 0 ;
+ agg::renderer_scanline_bin_solid<renderer_base_rgba_t > *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ void *argp3 = 0 ;
+ int res3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ 
+ if (!PyArg_ParseTuple(args,(char *)"OOO:render_scanlines_bin_rgba",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_rasterizer_scanline_aaT_t, 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "render_scanlines_bin_rgba" "', argument " "1"" of type '" "agg::rasterizer_scanline_aa< > &""'"); 
+ }
+ if (!argp1) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "render_scanlines_bin_rgba" "', argument " "1"" of type '" "agg::rasterizer_scanline_aa< > &""'"); 
+ }
+ arg1 = reinterpret_cast< agg::rasterizer_scanline_aa< > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_agg__scanline_bin, 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "render_scanlines_bin_rgba" "', argument " "2"" of type '" "agg::scanline_bin &""'"); 
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "render_scanlines_bin_rgba" "', argument " "2"" of type '" "agg::scanline_bin &""'"); 
+ }
+ arg2 = reinterpret_cast< agg::scanline_bin * >(argp2);
+ res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_agg__renderer_scanline_bin_solidTagg__renderer_baseTpixfmt_rgba_t_t_t, 0 );
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "render_scanlines_bin_rgba" "', argument " "3"" of type '" "agg::renderer_scanline_bin_solid<renderer_base_rgba_t > &""'"); 
+ }
+ if (!argp3) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "render_scanlines_bin_rgba" "', argument " "3"" of type '" "agg::renderer_scanline_bin_solid<renderer_base_rgba_t > &""'"); 
+ }
+ arg3 = reinterpret_cast< agg::renderer_scanline_bin_solid<renderer_base_rgba_t > * >(argp3);
+ agg::SWIGTEMPLATEDISAMBIGUATOR render_scanlines<agg::rasterizer_scanline_aa< >,agg::scanline_bin,agg::renderer_scanline_bin_solid<renderer_base_rgba_t > >(*arg1,*arg2,*arg3);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
 static PyMethodDef SwigMethods[] = {
 	 { (char *)"deg2rad", _wrap_deg2rad, METH_VARARGS, NULL},
 	 { (char *)"rad2deg", _wrap_rad2deg, METH_VARARGS, NULL},
@@ -30776,6 +30827,7 @@
 	 { (char *)"scanline32_bin_num_spans", _wrap_scanline32_bin_num_spans, METH_VARARGS, NULL},
 	 { (char *)"scanline32_bin_swigregister", scanline32_bin_swigregister, METH_VARARGS, NULL},
 	 { (char *)"render_scanlines_rgba", _wrap_render_scanlines_rgba, METH_VARARGS, NULL},
+	 { (char *)"render_scanlines_bin_rgba", _wrap_render_scanlines_bin_rgba, METH_VARARGS, NULL},
 	 { NULL, NULL, 0, NULL }
 };
 
@@ -31338,7 +31390,7 @@
 * structures together.
 *
 * The generated swig_type_info structures are assigned staticly to an initial 
- * array. We just loop though that array, and handle each type individually.
+ * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
Modified: trunk/matplotlib/src/swig_runtime.h
===================================================================
--- trunk/matplotlib/src/swig_runtime.h	2007年07月18日 17:21:11 UTC (rev 3565)
+++ trunk/matplotlib/src/swig_runtime.h	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.30
+ * Version 1.3.31
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
@@ -785,10 +785,13 @@
 #endif
 
 /* Py_ssize_t for old Pythons */
-#if PY_VERSION_HEX < 0x02050000
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
 typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
 #endif
-
 /* -----------------------------------------------------------------------------
 * error manipulation
 * ----------------------------------------------------------------------------- */
Modified: trunk/matplotlib/swig/agg.i
===================================================================
--- trunk/matplotlib/swig/agg.i	2007年07月18日 17:21:11 UTC (rev 3565)
+++ trunk/matplotlib/swig/agg.i	2007年07月18日 20:38:32 UTC (rev 3566)
@@ -107,4 +107,8 @@
 
 
 
+%template(render_scanlines_bin_rgba) agg::render_scanlines<
+ agg::rasterizer_scanline_aa<>,
+ agg::scanline_bin,
+ agg::renderer_scanline_bin_solid<renderer_base_rgba_t> >;
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3559
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3559&view=rev
Author: mdboom
Date: 2007年07月18日 08:41:59 -0700 (2007年7月18日)
Log Message:
-----------
Fix spacing when going from non-math to math.
Modified Paths:
--------------
 branches/mathtext_mgd/lib/matplotlib/mathtext.py
Modified: branches/mathtext_mgd/lib/matplotlib/mathtext.py
===================================================================
--- branches/mathtext_mgd/lib/matplotlib/mathtext.py	2007年07月18日 15:27:58 UTC (rev 3558)
+++ branches/mathtext_mgd/lib/matplotlib/mathtext.py	2007年07月18日 15:41:59 UTC (rev 3559)
@@ -1311,7 +1311,10 @@
 
 def non_math(self, s, loc, toks):
 #~ print "non_math", toks
- symbols = [SymbolElement(c) for c in toks[0]]
+ # This is a hack, but it allows the system to use the
+ # proper amount of advance when going from non-math to math
+ s = toks[0] + ' '
+ symbols = [SymbolElement(c) for c in s]
 self.symbols.extend(symbols)
 non_math = NonMathGroupElement(symbols)
 return [non_math]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3565
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3565&view=rev
Author: mdboom
Date: 2007年07月18日 10:21:11 -0700 (2007年7月18日)
Log Message:
-----------
Clean up logging. Remove dead function.
Modified Paths:
--------------
 branches/mathtext_mgd/lib/matplotlib/mathtext.py
Modified: branches/mathtext_mgd/lib/matplotlib/mathtext.py
===================================================================
--- branches/mathtext_mgd/lib/matplotlib/mathtext.py	2007年07月18日 17:18:15 UTC (rev 3564)
+++ branches/mathtext_mgd/lib/matplotlib/mathtext.py	2007年07月18日 17:21:11 UTC (rev 3565)
@@ -1088,7 +1088,6 @@
 return self.oy + self.height()
 
 def determine_font(self, font_stack):
- print "Space"
 # space doesn't care about font, only size
 for neighbor_type in ('above', 'below', 'subscript', 'superscript'):
 neighbor = self.neighbors.get(neighbor_type)
@@ -1110,7 +1109,6 @@
 
 def determine_font(self, font_stack):
 'set the font (one of tt, it, rm, cal, bf, sf)'
- print "sym:", self.sym, self.neighbors.keys()
 self.set_font(font_stack[-1])
 for neighbor_type in ('above', 'below', 'subscript', 'superscript'):
 neighbor = self.neighbors.get(neighbor_type)
@@ -1365,22 +1363,6 @@
 
 return [sym]
 
- def over_under(self, s, loc, toks):
- assert(len(toks)==1)
- where, sym0, sym1 = toks[0]
- #keys = ('above', 'below', 'subscript', 'superscript', 'right')
- print "where:", toks[0]
- if where==r'\over':
- sym0.neighbors['above'] = sym1
- elif where==r'\under':
- sym0.neighbors['below'] = sym1
- print sym0.neighbors.keys()
- 
- self.symbols.append(sym0)
- self.symbols.append(sym1)
-
- return [sym0]
-
 def accent(self, s, loc, toks):
 
 assert(len(toks)==1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3564
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3564&view=rev
Author: mdboom
Date: 2007年07月18日 10:18:15 -0700 (2007年7月18日)
Log Message:
-----------
Make \under and \over behave as in TeX. (i.e. it's {x \over y} not \over{x}{y})
Modified Paths:
--------------
 branches/mathtext_mgd/lib/matplotlib/mathtext.py
Modified: branches/mathtext_mgd/lib/matplotlib/mathtext.py
===================================================================
--- branches/mathtext_mgd/lib/matplotlib/mathtext.py	2007年07月18日 16:59:39 UTC (rev 3563)
+++ branches/mathtext_mgd/lib/matplotlib/mathtext.py	2007年07月18日 17:18:15 UTC (rev 3564)
@@ -1088,6 +1088,7 @@
 return self.oy + self.height()
 
 def determine_font(self, font_stack):
+ print "Space"
 # space doesn't care about font, only size
 for neighbor_type in ('above', 'below', 'subscript', 'superscript'):
 neighbor = self.neighbors.get(neighbor_type)
@@ -1109,6 +1110,7 @@
 
 def determine_font(self, font_stack):
 'set the font (one of tt, it, rm, cal, bf, sf)'
+ print "sym:", self.sym, self.neighbors.keys()
 self.set_font(font_stack[-1])
 for neighbor_type in ('above', 'below', 'subscript', 'superscript'):
 neighbor = self.neighbors.get(neighbor_type)
@@ -1208,6 +1210,10 @@
 font_stack.append(font_stack[-1])
 for element in self.elements:
 element.determine_font(font_stack)
+ for neighbor_type in ('above', 'below', 'subscript', 'superscript'):
+ neighbor = self.neighbors.get(neighbor_type)
+ if neighbor is not None:
+ neighbor.determine_font(font_stack)
 font_stack.pop()
 
 def set_font(self, font):
@@ -1359,16 +1365,17 @@
 
 return [sym]
 
- def composite(self, s, loc, toks):
-
+ def over_under(self, s, loc, toks):
 assert(len(toks)==1)
 where, sym0, sym1 = toks[0]
 #keys = ('above', 'below', 'subscript', 'superscript', 'right')
+ print "where:", toks[0]
 if where==r'\over':
 sym0.neighbors['above'] = sym1
 elif where==r'\under':
 sym0.neighbors['below'] = sym1
-
+ print sym0.neighbors.keys()
+ 
 self.symbols.append(sym0)
 self.symbols.append(sym1)
 
@@ -1440,8 +1447,10 @@
 }
 
 _subsuperscript_indices = {
- '_': (0, 1),
- '^': (1, 0)
+ '_' : ('normal', (0, 1)),
+ '^' : ('normal', (1, 0)),
+ 'over' : ('overUnder', (0, 1)),
+ 'under' : ('overUnder', (1, 0))
 }
 
 def subsuperscript(self, s, loc, toks):
@@ -1458,17 +1467,17 @@
 else:
 raise ParseException("Unable to parse subscript/superscript construct.")
 
- index, other_index = self._subsuperscript_indices[op]
+ relation_type, (index, other_index) = self._subsuperscript_indices[op]
 if self.is_overunder(prev):
- names = self._subsuperscript_names['overUnder']
- else:
- names = self._subsuperscript_names['normal']
+ relation_type = 'overUnder'
+ names = self._subsuperscript_names[relation_type]
 
 prev.neighbors[names[index]] = next
 
 for compound in self._subsuperscript_names.values():
 if compound[other_index] in next.neighbors:
- prev.neighbors[names[other_index]] = next.neighbors[compound[other_index]]
+ prev.neighbors[names[other_index]] = \
+ next.neighbors[compound[other_index]]
 del next.neighbors[compound[other_index]]
 elif compound[index] in next.neighbors:
 raise ValueError(
@@ -1486,6 +1495,7 @@
 latexfont = Forward().setParseAction(handler.latexfont).setName("latexfont")
 subsuper = Forward().setParseAction(handler.subsuperscript).setName("subsuper")
 placeable = Forward().setName("placeable")
+simple = Forward().setName("simple")
 expression = Forward().setParseAction(handler.expression).setName("expression")
 
 lbrace = Literal('{').suppress()
@@ -1499,9 +1509,6 @@
 | lparen 
 | rparen)
 
-subscript = Literal('_')
-superscript = Literal('^')
-
 bslash = Literal('\\')
 
 langle = Literal('<')
@@ -1529,11 +1536,6 @@
 | percent
 | ampersand)
 
-over = Literal('over')
-under = Literal('under')
-overUnder =(over
- | under)
-
 accent = oneOf("hat check dot breve acute ddot grave tilde bar vec "
 "\" ` ' ~ . ^")
 
@@ -1602,10 +1604,7 @@
 group = Group(
 lbrace
 + OneOrMore(
- space
- | font
- | latexfont
- | subsuper
+ simple
 )
 + rbrace
 ).setParseAction(handler.group).setName("group")
@@ -1618,40 +1617,36 @@
 + latex2efont
 + group)
 
-composite = Group(
- Combine(
- bslash
- + overUnder
- )
- + group
- + group
- ).setParseAction(handler.composite).setName("composite")
-
 placeable <<(accent
 ^ function 
 ^ symbol
 ^ group
- ^ composite
 )
 
+simple <<(space
+ | font
+ | latexfont
+ | subsuper)
+
+subsuperop =(Literal("_")
+ | Literal("^")
+ | (Suppress(bslash) + Literal("under"))
+ | (Suppress(bslash) + Literal("over"))
+ ) 
+
 subsuper << Group(
 (
 placeable
 + ZeroOrMore(
- ( subscript
- | superscript
- )
+ subsuperop
 + subsuper
 )
 )
- | (( subscript | superscript) + placeable)
+ | (subsuperop + placeable)
 )
 
 math = OneOrMore(
- space
- | font
- | latexfont
- | subsuper
+ simple
 ).setParseAction(handler.math).setName("math")
 
 math_delim =(~bslash
@@ -1669,7 +1664,6 @@
 + non_math
 )
 )
- 
 
 ####
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 3563
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3563&view=rev
Author: mdboom
Date: 2007年07月18日 09:59:39 -0700 (2007年7月18日)
Log Message:
-----------
Oops. Dotless i was already in there as \imath
Modified Paths:
--------------
 branches/mathtext_mgd/lib/matplotlib/_mathtext_data.py
Modified: branches/mathtext_mgd/lib/matplotlib/_mathtext_data.py
===================================================================
--- branches/mathtext_mgd/lib/matplotlib/_mathtext_data.py	2007年07月18日 16:53:11 UTC (rev 3562)
+++ branches/mathtext_mgd/lib/matplotlib/_mathtext_data.py	2007年07月18日 16:59:39 UTC (rev 3563)
@@ -112,8 +112,6 @@
 r'\phi' : ('cmmi10', 42),
 r'\chi' : ('cmmi10', 17),
 r'\psi' : ('cmmi10', 31),
- r'\i' : ('cmmi10', 8),
- r'\j' : ('cmmi10', 65),
 
 r'(' : ('cmr10', 119),
 r'\leftparen' : ('cmr10', 119),
@@ -750,7 +748,8 @@
 r'\Diamond' : ('psyr', 224),
 r'\langle' : ('psyr', 225),
 r'\Sigma' : ('psyr', 229),
- r'\sum' : ('psyr', 229)
+ r'\sum' : ('psyr', 229),
+
 }
 
 # Automatically generated.
@@ -2572,8 +2571,7 @@
 'divideontimes': 8903,
 'lbrack': 91,
 'textquotedblright': 8221,
-'Colon': 8759,
-'i': 305}
+'Colon': 8759}
 
 uni2tex = dict([(v,k) for k,v in tex2uni.items()])
 
@@ -3051,8 +3049,7 @@
 'divideontimes': 'uni22C7',
 'lbrack': 'bracketleft',
 'textquotedblright': 'quotedblright',
-'Colon': 'uni2237',
-'i': 'uni0131'}
+'Colon': 'uni2237'}
 
 type12tex = dict([(v,k) for k,v in tex2type1.items()])
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing results of 5455

<< < 1 .. 215 216 217 218 219 > >> (Page 217 of 219)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /