[SciPy-User] scipy.interpolate.UnivariateSpline overshoot (with picture)

Kevin Gullikson kevin.gullikson.signup at gmail.com
Tue Sep 11 14:57:46 EDT 2012


Brad,

I think playing with the 's' parameter is the way to do this. That data
looks like you could just straight interpolate it (s=0). s can be a float
too, so maybe something like 0.5 would be better?

-Kevin

On Tue, Sep 11, 2012 at 12:49 PM, Brad Malone <brad.malone at gmail.com> wrote:

> Hi, I am trying to use scipy.interpolate.UnivariateSpline to interpolate a
> region of a plot I have where there are few data points. See the figure of
> my data here: http://tinypic.com/r/dq4o3s/6
>
> The red and blue data points are my raw data (the blue points simply being
> the subset of the red data that I want to obtain an interpolated curve
> from). I created a sublist of the blue points and then called
>
>    s=UnivariateSpline(newx,newy,s=1)
>
>
> The blue line is the spline interpolated on a grid of 1000 points between
> my initial blue raw data point and my final blue raw data point. As you can
> see, the spline works quite well, except for at the peak of the curve where
> it overshoots a tad bit. I was curious as to whether there was an easy fix
> to this (perhaps an option to UnivariateSpline that I am unaware of). If
> not, any other solutions to correct this overshoot?
>
> I appreciate any suggestions you can give.
>
> Best,
> Brad
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120911/8834e459/attachment.html>


More information about the SciPy-User mailing list