Ludwig Schwardt wrote:
> Does the new path simplification code use a similar approach to snd?
> I've always wanted something like that in matplotlib... :-)
>
>
Not knowing the details of what snd is doing, I would say "probably".
The general idea is to remove points on-the-fly that do not change the
appearance of the plot at the given resolution. Spending the time to do
this at the front speeds up the path stroking immensely as it has fewer
vertices and therefore fewer self-intersections to compute. I suspect
what matplotlib is doing is a little more general, and therefore not
quite as efficient as snd, because it can't assume a 1-dimensional time
series.
To give credit where it is due, the path simplification was originally
written by Allan Haldane and has been in matplotlib for some time. The
recent work has been to fix some bugs when dealing with some degenerate
cases, to improve its performance, greatly improve the clipping
algorithm and allow the tolerance to be user-configurable.
Mike
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA