Re: Using Locators in Mathematica v6

*To*: mathgroup at smc.vnet.net*Subject*: [mg76528] Re: Using Locators in Mathematica v6*From*: ragfield <ragfield at gmail.com>*Date*: Wed, 23 May 2007 05:36:05 -0400 (EDT)*References*: <f2u4tq$jv5$1@smc.vnet.net>

On May 22, 1:08 am, "Coleman, Mark" <Mark.Cole... 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. > > In my dynamic example, I'd like to have a locator button appear on the > graph such that the (x,y) location of the locator becomes an additional > data point in the overall data set, and thereafter a new line of best > fit is calcuated and displayed. Thus as the user moves the locator, a > new best fit line is displayed. Something like this? http://demonstrations.wolfram.com/SimpleBestFitLine/ -Rob