Hello there, IDL has many options to perform mathematical curve fitting. The tool most appropriate will depend on your data. Here is a link to all the options: https://www.harrisgeospatial.com/docs/routines-47.html Below I have included a simple example using LINFIT, great for creating a "line of best fit" for your plotted data. ====== ;create 2D data x = findgen(200)/2. y = 8*sin(x)+x ;create a line of best fit for your data using LINFIT coeffs = linfit(x,y) line = coeffs[1]*x+coeffs[0] ;create plots of data (x's) and linear fit (red line) p = plot(x,y,linestyle=6,symbol='x') p2 = plot(x,linear_fit,color='red',linestyle=2,/overplot,thick=2) ======
|