How to put the marker data over the curve fitting line?
Show older comments
Hello, I'm using curvefit with 555 data markers.
the default settings put the curve fit line over the data points. How do I reverse the order?
5 Comments
Scott MacKenzie
on 16 Aug 2021
It might help if you post your code.
Oded Ben Tsedek
on 16 Aug 2021
Scott MacKenzie
on 16 Aug 2021
Edited: Scott MacKenzie
on 16 Aug 2021
Well, you could perhaps post the data and the code that generates the plot you are trying to fix. To get the code, use File --> Generate Code from the Curve Fitting Toolbox menu.
Oded Ben Tsedek
on 16 Aug 2021
Scott MacKenzie
on 16 Aug 2021
You note: the default settings put the curve fit line over the data points. That's not what I see. My plot has the points over the curve fit line.
Perhaps post the data and an image showing the plot you are seeing.
Answers (2)
Oded Ben Tsedek
on 16 Aug 2021
0 votes
Scott MacKenzie
on 16 Aug 2021
Edited: Scott MacKenzie
on 16 Aug 2021
0 votes
You posted your reply comment as an answer. Oops.
But, I see your point. And I'll try to explain here as an answer (although I'm not sure if this is exactly what you are after).
It seems the figure in the Curve Fitting Toolbox is different from the figure generated if you save the code and run it from the MATLAB Editor. The 1st figure below is for your data. It was generated from the curve-fitting code after saving the code and running it from the MATLAB Editor. The data points (blue) are an exact fit with the model. This makes it difficult to distinguish the points from the line (red). The 2nd figure is a zoomed-in segment which reveals that the points are indeed on top of the line, which is what you want.
So, if you save the code and run it from the MATLAB Editor, you'll get the figure you want.


Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!