Are there any plans for path simplification in any of the non-agg backends?
When plotting large numbers of data points (~50k upwards in my case) using the
ps backend the resulting file are rather large (several MB). More of a concern
is that they take a very long time (~5 minutes) to render with ghostscript on a
modern computer with obvious negative implications if sending to a postscript
printer / including in publication graphics.
I've added some _very_ simple path simplification to backend_ps.py, which is
sufficient for my usage (see attached diff - against 0.98pre, rev 5075). Its
pretty ugly though with an arbitrary delta value for determining whether it is
safe to skip a point, and a boolean switch to turn it on & off, both currently
as module-level variables.
If there is enough interest, and I was pointed in the direction of the
necessary info I could try and clean it up a bit for potential inclusion.
I'd need to know the following:
Is the backend itself the best/preferred place to be doing path simplification?
What would be the best method of doing the configuration (turning on/off,
setting delta)?
It would obviously be desirable to automagically select a reasonable delta
value - although this is potentially difficult as the resulting graph can be
arbitrarily scaled - any ideas?
best wishes,
David
Win a MacBook Air or iPod touch with Yahoo!7.
http://au.docs.yahoo.com/homepageset
41a42,46
> #Added for path simplification , D.B. 14/8/08
> simplify = True
> simplifyDelta = 0.1
> #end simplify
>
440a446,447
>
> prev_points = None #added for path simplification (D.B.)
443a451
> prev_points = points
445c453,456
< ps.append("%g %g l" % tuple(points))
---
> skip = abs(points[0] - prev_points[0]) < simplifyDelta and abs(points[1] - prev_points[1]) < simplifyDelta
> if not simplify or not skip:
> ps.append("%g %g l" % tuple(points))
> prev_points = points
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel