How can I add error bars on a scatter plot using the calculated errors?

2 次查看(过去 30 天)
I want to add error bars to this graph: (SEM is the standard error mean for Dt, and I want to add error bars only onto Dt in the graph)
dfs= [ 0 4.5000 9.0000 13.5000 18.0000 22.5000 27.0000 31.5000]
Dt= [ 4.1681 4.1719 3.8631 4.1915 3.2843 3.2850 3.2308 3.2795]
R= [ 6.2272 7.4491 8.4765 7.7533 9.3598 12.9844 13.9740 9.2937]
f(1)=figure; plot (dfs.',Dt,'ro',dfs.',R,'bo');
SEM = [ 0.0142 0.0142 0.0127 0.0164 0.0183 0.0224 0.0193 0.0232];
Thanks!

采纳的回答

Star Strider
Star Strider 2014-7-18
The SEM values are sufficiently small that they appear as small horizontal bars. This plots both of your data series, with the error bars only plotted for Dt:
figure(1)
errorbar(dfs, Dt, SEM, 'ro')
hold on
plot(dfs,R,'bo')
hold off

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Bar Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by