How to make the errorbar and the data line have different line width
76 次查看(过去 30 天)
显示 更早的评论
I am trying to plot a like with errorbar using errorbar function.
dt = [sin((1:10));cos((1:10))]
errorbar(mean(dt),std(dt))
When you change the LineWidth in the errorbar function, both the errorbar and the data line were changed. For example
errorbar
(mean(dt),std(dt),'LineWidth',5)
I am wondering if there is a way to change the two line width seperately using the errorbar properties without plotting two plots
0 个评论
采纳的回答
Star Strider
2021-10-28
Use a marker with errorbar and plot the errorbar separately from the original curve—
dt = [sin((1:10));cos((1:10))];
figure
plot(mean(dt))
hold on
errorbar(mean(dt),std(dt), '.b', 'LineWidth',5, 'MarkerSize',0.1)
hold off
This defines the line style and then sets the marker size ot a very small value, so that the marker itself does not show.
.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Errorbars 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!