How to add Error Bars in fit curve line graph?
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!