From: Darren D. <dd...@co...> - 2006-04-04 20:30:44
|
On Monday 03 April 2006 22:16, John Hunter wrote: > >>>>> "Darren" == Darren Dale <dd...@co...> writes: > Darren> Also, if I do the transform in backend_ps, instead of > Darren> passing it to the postscript interpreter, I see a big > Darren> speedup at render time. Right now I am doing this > Darren> transform by hand: > > Darren> a,b,c,d,tx,ty=vec6 xo = a*x+c*y +tx yo = b*x+d*y + ty x,y > Darren> = xo,yo > > Darren> Is there a better way to do this? I thought I could simply > Darren> call numerix_x_y, but that function is not compatible with > Darren> nonlinear transforms (returns a domain error if one of the > Darren> axes is log-scaled). > > You can transform the xy values point by point. Instead of separating > them into their nonlinear and affine components as we are currently > doing in backend_ps, you can call trans.xy_tup which will do both. If > successful, it will return the transformed xy, if it fails, it will > raise a ValueError, and you can set the moveto/lineto state > accordingly. I see a draw_lines_testing in backend_ps. I think it could be a good approach, but it doesnt make it very easy to skip unplottable elements like nans, infs. Could xy_tup accept a kwarg to make it raise an error when it tries to transform an inf or a nan? Darren |