On Wed, Jul 2, 2008 at 2:53 PM, Brent Pedersen <[EMAIL PROTECTED]> wrote:
> hi, for pylab.plot, i am able to get the transform like this:
>
>    import pylab
>    xs = [0, 999]
>    ys = [10, 555]
>
>    f, = pylab.plot(xs, ys)
>    t = f.get_transform()
>    print t.transform(zip(xs, ys))
>
>
> how can i do that for a pylab.scatter? this:
>
>    s = pylab.scatter(xs, ys)
>    print s.get_transform().transform(zip(xs, ys))
>
> simply prints the original x,y coordinates unaltered. the only way i'm
> able to do this, is to plot() the points, get the transform t,
> scatter() the points, and
> then set the transform. how can i get the transform directly?
>
> thanks,
> -brentp
>

as it goes, i figured this out after sending. the code below does the trick.
but i'm not sure why i have to manually set the transform.


    s = pylab.scatter(xs, ys)
    s.set_transform(s.axes.transData)
    print s.get_transform().transform(zip(xs,ys))

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to