How to add Error Bars in fit curve line graph?
1 view (last 30 days)
Show older comments
Hey!
I want to put Error Bars in my line graph, I am using " fit " function on my data to smooth curves. And it is working fine. But I dont know how to put error bars on line graph while using ' fit " function. Below is the attached file of the dataset I am using and code.
clear all
clc
load('MCA_Disjoint_SegmentWise.mat')
Data1LDA = MCA_Disjoint(: , 1);
Data2LDA = MCA_Disjoint(: , 3);
Data3LDA = MCA_Disjoint(: , 5);
WindowSizes = 50:25:450;
WindowSizes = WindowSizes';
f1=fit(WindowSizes,Data1LDA,'cubicinterp');
f2=fit(WindowSizes,Data2LDA,'cubicinterp');
f3=fit(WindowSizes,Data3LDA,'cubicinterp');
figure
hold on
p(1,:) = plot(f1,WindowSizes,Data1LDA);
p(2,:) = plot(f2,WindowSizes,Data2LDA);
p(3,:) = plot(f3,WindowSizes,Data3LDA);
set(p(1,:),'LineWidth',2,...
'Color','black',...
'MarkerEdgeColor','k',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',20)
set(p(2,:),'LineWidth',2,...
'Color','red',...
'MarkerEdgeColor','r',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',20)
set(p(3,:),'LineWidth',2,...
'Color','blue',...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[.49 1 .63],...
'MarkerSize',20)
0 Comments
Answers (0)
See Also
Categories
Find more on Bar Plots 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!