Hi everybody,

A number of years ago I wrote a function to do Lowess smoothing to calculate a smooth curve through a scatter plot. I copied an example script below and attached the resulting figure to this mail.

I think that such a smoothing function would be a useful addition to matplotlib. Does anybody have any objections against me adding this to matplotlib? If not, what would be a suitable place to put this function?

--Michiel.

from pylab import *

x = arange(0,10,0.01)

ytrue = exp(-x/5.0) + 2*sin(x/3.0)

# add random errors with a normal distribution

y = ytrue + normal(size=len(x))

scatter(x,y,color='cyan')

# calculate a smooth curve through the scatter plot

ys = smooth(x, y, 'lowess')

plot(x,ys,'red',linewidth=3)

# draw the true values for comparison

plot(x,ytrue,'green',linewidth=3)