I would like to add a trend line onto a scatter plot

19 views (last 30 days)
I would like to add a trend line, or lines connecting to two data plots next each other, onto a scatter plot.
Thanks,

Answers (1)

Image Analyst
Image Analyst on 22 Jul 2014
See my polyfit demo, attached below the picture.
  5 Comments
Image Analyst
Image Analyst on 23 Jul 2014
plot() does not require the x values of the data to be equispaced.
You did not describe what the volatility smile is (so I still don't know), nor what the red and blue curves represent. Plus, I don't see any fitting/trending, just two sets of data with lines going between every adjacent pair of points.
Kxx
Kxx on 24 Jul 2014
Sorry, it becomes too wordy if I explain what the volatility smile is here. Anyway, the plot chart works well. Thank you for your help.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!