フィルターのクリア

How to make the errorbar and the data line have different line width

85 ビュー (過去 30 日間)
Fan Yang
Fan Yang 2021 年 10 月 28 日
回答済み: Star Strider 2021 年 10 月 28 日
I am trying to plot a like with errorbar using errorbar function.
dt = [sin((1:10));cos((1:10))]
dt = 2×10
0.8415 0.9093 0.1411 -0.7568 -0.9589 -0.2794 0.6570 0.9894 0.4121 -0.5440 0.5403 -0.4161 -0.9900 -0.6536 0.2837 0.9602 0.7539 -0.1455 -0.9111 -0.8391
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

採用された回答

Star Strider
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 件)

カテゴリ

Help Center および File ExchangeErrorbars についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by