Re: Joining points of ListPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg117405] Re: Joining points of ListPlot
- From: Ray Koopman <koopman at sfu.ca>
- Date: Thu, 17 Mar 2011 06:33:37 -0500 (EST)
- References: <ilnh7k$o97$1@smc.vnet.net>
On Mar 15, 4:06 am, Antonio Mezzacapo <ant.mezzac... at gmail.com> wrote: > Yeah I think you are right Bob, > maybe the attachment isn't reachable to everyone. > > I have uploaded the data here > http://www.easy-share.com/1914242675/AntonioListPlot.txt > <http://www.easy-share.com/1914242675/AntonioListPlot.txt> > > Antonio Length[rr = Cases[data,{_Real,_Real}]] 2563 With[{a1 = -.04, b1 = .36, c1 = .1, a2 = .19, b2 = .34, c2 = .1}, Plot[{ a1 + b1*(Sqrt[c1^2 + (x-Pi)^2] - c1), -a1 - b1*(Sqrt[c1^2 + (x-Pi)^2] - c1), a2 + b2*(Sqrt[c2^2 + (x-Pi)^2] - c2), -a2 - b2*(Sqrt[c2^2 + (x-Pi)^2 ]- c2)}, {x,Min@rr[[All,1]],Max@rr[[All,1]]}, PlotRange->{Min@rr[[All,2]],Max@rr[[All,2]]}*1.05, Frame->True, Axes->None, Prolog->{PointSize[.007],Orange,Point/@rr,Black}]] - Graphics - Assign each point to the function that it's closest to. The fitting was done by eye and is far from perfect, but it may suffice. Of course, you may also want to improve the fit or try different forms.