On 2/1/07, Nicolas <[EMAIL PROTECTED]> wrote: > I tried to use some affine transformations, but it didn't match to get it > works. > I use matplotlib 0.87.5 with python 2.4.3 and Numeric 24.2 on winXP. > > I tried for example : > plot([1,0,1],[0,1,0], transform = matplotlib.transforms.Affine(0,1,1,0,0,0))
You cannot pass scalars to the Affine constructor -- matplotlib uses value reference semantics in the transform, as explained at http://matplotlib.sf.net/matplotlib.transforms.html and so you need to construct your transformation like so: import matplotlib.transforms as t def make_affine(a,b,c,d,tx,ty): return t.Affine(*[t.Value(val) for val in (a,b,c,d,tx,ty)]) a = make_affine(0,1,1,0,0,0) >>> print a.xy_tup((1,1)) (1.0, 1.0) >>> print a.xy_tup((-1,1)) (1.0, -1.0) Note there was a bug in older versions of mpl in the affine class that was fixed, specifically in the sign of b and c. I am not sure which version that was off the top of my head, so if you see any problems consider upgrading. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users