I think that LINFIT, PLOT, and the SCATTERPLOT function can be used to accomplish this task. An example of this is shown below:
X = [-3.20, 4.49, -1.66, 0.64, -2.43, -0.89, -0.12, 1.41, 2.95, 2.18, 3.72, 5.26]
Y = [-7.14, -1.30, -4.26, -1.90, -6.19, -3.98, -2.87, -1.66, -0.78, -2.61, 0.31, 1.74]
p = SCATTERPLOT(x,y,SYM_COLOR='red',/SYM_FILLED)
result = LINFIT(X, Y, CHISQR=chi)
xfit = findgen(11) - 4
yfit = result[1]*xfit + result[0]
lin_plot = plot(xfit, yfit, /overplot)
I hope that this will be helpful to you.
David
Harris Geospatial Solutions
|