How to produce a scatter plot with smooth line for this plot?
Show older comments
Attached is the capture.png which shows the desired smooth plot that I would like to have. FYP Sample Data.PNG is what I have been getting through the codes below but I need smooth plot just like the one produced in Capture.png.
Can anyone guide how can I produce scatter plot with smooth lines please similar to the Capture.PNG?
Appreciate if anyone can help me. God Bless You!
data = xlsread("sampleexceldata.xlsx") ;
K = data(1,[1 3 5]) ; % factors
data(1,:) = [];
s1 = data(:,1) ; f1 = data(:,2) ;
s2 = data(:,3) ; f2 = data(:,4) ;
s3 = data(:,5) ; f3 = data(:,6) ;
figure
yyaxis right
plot(s3,f3,'g-o',s2,f2,'b-+')
axis ([0 5 0 90])
ylabel('Force (N)');
yyaxis left
plot(s1,f1,'r-*')
axis ([0 5 0 13])
grid on
title('Force vs Displacement');
xlabel('Displacement (mm)');
ylabel('Force (N)');
Accepted Answer
More Answers (0)
Categories
Find more on Annotations 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!