How can I plot points on a graph along with the smoothed values?
7 views (last 30 days)
Show older comments
I am able to plot points on a graph, but when I apply smoothing I am unable to plot the same points in my graph.
I tried to use filters and also tried changing span values. Is there any other way to plot points on a non-linear graph?
1 Comment
Doug Hull
on 20 Jan 2011
I am assuming that you have the original data and smoothed data and are just trying to plot it. If not, please clarify the question.
Accepted Answer
Doug Hull
on 20 Jan 2011
You want to plot them both, either using hold on between plots, or in the same plot command.
original_x = [1.0 2.0 3.0];
original_y = [4.0 5.1 6.0];
smoothed_x = [1.0 1.5 2.0 2.5 3.0]; %get these how you want
smoothed_y = [4.0 4.5 5.0 5.5 6.0]; %get these how you want
plot(original_x, original_y, 'ro', smoothed_x, smoothed_y, 'b-')
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!