Smoothing function, or best-fit line for XY Chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Jonathan

Smoothing function, or best-fit line for XY Chart

Post by Jonathan » Sat Nov 27, 2004 2:23 pm

Hey again All,

Now that I've got the classpath working, I am running into the slight problem of not having my XY lines looking "nice". I was curious if there was a way (or some function) to turn my XY graphs with points of data into a graph with just a smooth line showing the best-fit graph of all the points? Thanks if anyone has any ideas on how to accomplish this. :?

Sincerely,

Jonathan

Jonathan

Possible idea?

Post by Jonathan » Mon Nov 29, 2004 7:47 am

Maybe it'd be possible to do this by imagining 3 coordinates for an easy example: taking 1st and 2nd points and figuring out their slope from the x,y coordinates. Do the same and find the slope for points 2 and 3. Then taking the two slopes average them together and you have the best fit line possibly? And then once you find their averaged slope, you can take points 3rd and fourth and find the next slope to average into the 1st through 3rd points average. Haven't tested this but this "simple" approach is probably too simple and wouldnt go too well... Hoping someone knows if JCharts has a better way to do this.. Thanks. =) Hope you all had a great Thanksgiving! :)

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Smoothing function, or best-fit line for XY Chart

Post by david.gilbert » Mon Nov 29, 2004 9:41 am

Jonathan wrote:I was curious if there was a way (or some function) to turn my XY graphs with points of data into a graph with just a smooth line showing the best-fit graph of all the points?
It isn't supported at present. JFreeChart will just connect the given (x,y) points with line segments.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Jonathan

Thanks for letting me know

Post by Jonathan » Mon Nov 29, 2004 9:50 am

If I ever program a smoothing line function that works I guess I'll let ya know....

arkadye
Posts: 9
Joined: Fri May 19, 2006 7:02 pm

Re: Smoothing function, or best-fit line for XY Chart

Post by arkadye » Fri May 19, 2006 7:08 pm

david.gilbert wrote:
Jonathan wrote:I was curious if there was a way (or some function) to turn my XY graphs with points of data into a graph with just a smooth line showing the best-fit graph of all the points?
It isn't supported at present. JFreeChart will just connect the given (x,y) points with line segments.
Hi David,

In one of your previous posts you said that automatic line smoothing is supported (see http://www.jfree.org/phpBB2/viewtopic.p ... +smoothing).

So is it supported? And if it is not supported, are you planning to support it in the next release?

Thanks,

Arkady.

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Mon May 22, 2006 7:33 am

Maybe there is a missunderstanding? JFreeChart has an anti-aliasing function which can be also called "smoothing".

But you want to have a fitting function which is not supportet by JFreeChart directly. I also doubt it is the aim of JFreeChart to incorporate statistic function because there are huge libraries for doing this like SSJ.

http://www.iro.umontreal.ca/~simardr/ssj/

plunavat
Posts: 29
Joined: Sun Jan 01, 2012 10:59 am
antibot: No, of course not.

Re: Smoothing function, or best-fit line for XY Chart

Post by plunavat » Fri Jan 04, 2013 3:36 pm

Hello,

I am looking for solution of similar Problem. can someone let me know if you have found the solution to plot best fit curve for given points

Regards,
Pranav C Lunavat

Locked