フィルターのクリア

Errorbar overlapping with the left and right border of a plot

4 ビュー (過去 30 日間)
Fan Yang
Fan Yang 2021 年 10 月 27 日
コメント済み: Star Strider 2021 年 10 月 28 日
a = [1,2,3,4;5,6,7,8]
errorbar(mean(a),std(a))
The two lines of code above generate an line of mean value with errorbars. However, the leftmost and the rightmost errorbar overlapped with the left and right border of the plot. Is there anyway to avoid it?

採用された回答

Star Strider
Star Strider 2021 年 10 月 27 日
Add an xlim (or axis) call —
a = [1,2,3,4;5,6,7,8]
a = 2×4
1 2 3 4 5 6 7 8
figure
errorbar(mean(a),std(a))
xlim(xlim+[-1 1]*0.2) % <— ADD THIS
Make appropriate changes to get the desired result.
.
  2 件のコメント
Fan Yang
Fan Yang 2021 年 10 月 28 日
Thanks, Star Strider!
Star Strider
Star Strider 2021 年 10 月 28 日
As always, my pleasure!
.

サインインしてコメントする。

その他の回答 (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