John (and others),

I've made a quick change to the svg backend to cull the data, see attached
patch. I haven't tested it extensively, but it seems OK. It culls both
lines and polygons out of svg output.

About making it general across backends: I've looked a bit at how things
get rendered, and here is what I understand: We can only do the culling in
pixel coordinates, since the height/width of the figure is in pixel units.

The transform from unit to pixel coordinates either happens in
Line2D.draw() (such as SVG), or in the backend's draw function (such as
for agg). Therefore we could only generalize for the case where the
transform is in line2d, and even then, it looks simpler to do it in the
backend to me since that is the only place we conveniently have all the
pixel information we need. Maybe I have misunderstood, though.

Also, I noticed I forgot to comment out a degugging cout from my last agg
patch, near the end of draw_lines. Oops, sorry, you should fix that in
svn.

Allan


By the way, Here's what I used to test the svg patch, using the -dSVG switch:

import pylab
from scipy import *

pylab.plot(sin(arange(1000)*pi/100.0))
pylab.plot(rand(1000)*2, '.')

pylab.axis([300, 800, -0.5, 1])
pylab.savefig('test')

Attachment: svgpatch
Description: Binary data

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to