restore,'circdata.sav' ploterror,x,y,xerr,yerr,ps=1 guessp = [30., 50., 10., (3./!radeg), (32./!radeg)] fa = {T:t, XVAL:x, YVAL:y, XERR:xerr, YERR:yerr} p = mpfit('mycirc',guessp,functargs=fa) plot_t = findgen(100) outx = p[0] + p[2]*sin(p[3]*plot_t + p[4]) outy = p[1] + p[2]*cos(p[3]*plot_t + p[4]) oplot,outx,outy,color=getcolor('red'),thick=3 stop end