You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like it if I were able to set some really basic curve fitting for a plot without having to rely on other packages and complex solutions to smooth out curve data. Its not the most useful feature data analysis wise, but its much more pleasant to look at to see a general smooth trend rather than always just having the straight lines between points.
Proposed Solution
Add an option to plotting to customize the amount of smoothness of the curve. 0 smoothness being what plot already does by just connecting the dots, and increasing values of smoothness increase the amount of smoothing done to the curve.
Additional context and prior art
There are some close solutions but nothing is perfect. The closest I've gotten is
where x and y are some lists of data. This solution comes close in some cases, but it is very finicky and doesn't always work. Any proposed solution I have found, usually works about the same and isn't a perfect fix.
I know that curve fitting is a very complex problem, and I'm not looking for a perfect interpolation of data, I just want to be able to smooth out the jaggedness of a curve to show a general trend in the data for visuals sake.
The text was updated successfully, but these errors were encountered:
Thanks for the proposal. As you say, there is no general good solution for smoothing data. It depends on the context. There is no free lunch here.
I'm strictly 👎 on this for multiple reasons:
From a technical standpoint I'm against adding half-working features to the library. This will trigger complaints on the non-working cases.
Providing a "smooth this data" function is dangerous. It creates the false illusion that one can simply apply a fixed algorithm and get meaningful data out.
Most of the time, you should plot data as is anyway. Choosing a good style helps to keep the desired message across. If you have noisy data, it's often good to use individual markers and not a line. Then you don't have a jagged curve. You might add a model as a line on top, but then again, you have to think what the model should be and cannot just "smooth". In that sense, providing generic smoothing would rather seduce people to misrepresent their data.
@lzerpizer, I completely agree that its nice to smooth data once in a while, but as you say, "...it is very finicky and doesn't always work." Its really hard to come up with a generic smoother, and thats why there are many of them in numpy and scipy. Are you over-sampled or under-sampled? Do you want your curve to pass through the data points? Or smooth the data points? How many orders do you want that spline to be? How much ringing or phase shift in your filter are you willing to accept?
Where matplotlib has gotten in trouble historically is trying to onboard data-processing. Sounds reasonable for one case, but then it ends up a 50 keyword-arg monstrosity to cover everyone else's case.
Problem
I would like it if I were able to set some really basic curve fitting for a plot without having to rely on other packages and complex solutions to smooth out curve data. Its not the most useful feature data analysis wise, but its much more pleasant to look at to see a general smooth trend rather than always just having the straight lines between points.
Proposed Solution
Add an option to plotting to customize the amount of smoothness of the curve. 0 smoothness being what plot already does by just connecting the dots, and increasing values of smoothness increase the amount of smoothing done to the curve.
Additional context and prior art
There are some close solutions but nothing is perfect. The closest I've gotten is
where x and y are some lists of data. This solution comes close in some cases, but it is very finicky and doesn't always work. Any proposed solution I have found, usually works about the same and isn't a perfect fix.
I know that curve fitting is a very complex problem, and I'm not looking for a perfect interpolation of data, I just want to be able to smooth out the jaggedness of a curve to show a general trend in the data for visuals sake.
The text was updated successfully, but these errors were encountered: