Re: Using Locators in Mathematica v6
- To: mathgroup at smc.vnet.net
- Subject: [mg76505] Re: [mg76443] Using Locators in Mathematica v6
- From: "Lev Bishop" <lev.bishop+mathgroup at gmail.com>
- Date: Wed, 23 May 2007 05:24:09 -0400 (EDT)
- References: <200705220653.CAA20073@smc.vnet.net>
On 5/22/07, Coleman, Mark <Mark.Coleman at libertymutual.com> wrote: > Briefly, I want to illustrate the effects that outlier points an have on > a line of best fit. For my example, I generate a small random set of > points (x(i), y(i)), where y(i) = a + b x(i) + randomerror(i), for > values a and b. I then calculate the line of best fit using Fit[ ]. I > next ListPlot[ ] the underlying set of points and overlay the resulting > line from Fit[ ]. So far very simple. >From the help at tutorial/IntroductionToManipulate there's this, which lets you choose a fitting polynomial order, and add/remove locator points by command/alt clicking in a blank area/existing locator. Manipulate[Module[{x},Plot[Fit[points,Table[x^i,{i,0,order}],x],{x,-2,2},PlotRange->2,ImageSize->500,Evaluated->True]], {{order,3},1,10,1,Appearance->"Labeled"},{{points,RandomReal[{-2,2},{5,2}]},Locator,LocatorAutoCreate->True}]
- References:
- Using Locators in Mathematica v6
- From: "Coleman, Mark" <Mark.Coleman@LibertyMutual.com>
- Using Locators in Mathematica v6