What is the best method to constrain multiple locator points to a set of data? A while back, I needed a program that could perform a linear fit for a specified range of data points. In an effort to create more work for myself, I decided to utilize
LocatorPane to define end points for the fit range. The key to this program was constraining both locator points and making them snap-to points along the data set. I was able to cobble together code in Mathematica 10 that did just that (see example):
Recently, I switched to a new version of Mathematica (11.0.1). Now, when I use this code, I get
Part errors. Since my code is a bit ridiculous, I think the best option is a rewrite. What is the best method to constrain multiple locator points to a set of data?
I can attach my code if you'd like to take a look, but it's pretty messy.