Michael Droettboom <mdroe@...552...> writes:
> Thanks for the pointers.
> The original simplification code was written by John Hunter (I believe),
> and I don't know if it was designed by him also or is a replication of
> something published elsewhere. So I take no credit for and have little
> knowledge of its original goals.
I'm not sure on everything it does, but it seems to do clipping and removes
line segments where the change in slope is less than some limit. There are
probably better algorithms out there, but this one works surprisingly well
and is fast and simple. I think it should be a requirement that it returns
points which are a subset of the original points- with the change you've
made it does this, right?
Oh Hey! I'm the one who originally wrote the path simplification code. I'd
have thought it would be gone by now, but I am very happy it turned out to
be useful. I made it up in order to plot a very large set of noisy data I
The goal was to simplify two types of plots at once: Smooth curves, as
well as very noisy data where many lines are 'on top' of each other. (eg
plot(rand(100000)) ). I noticed both could be taken care of by checking
for changes in slope.
An important goal (for me) was making sure that the min/max span of the
points plotted was preserved. (so that eg plot(rand(1000)) spans from the
lowest to highest point in the data (ie ~ 0 to 1) for any zoom factor).
I'm not sure if this property survived...: If you do plot(rand(1000)) with
the latest matplotlib and gradually zoom out on the x axis, you can see
the top/bottom tips of the plotted line flickering in height, which is
what I was trying to avoid. I forget whether I actually got it as I wanted
it though, maybe I gave up.