fix plotting for curve fit
pass state data into curvefit functions and plotters