Hi all,
is there a way to add custom labels to each errorbar in an erroplot using a code (instead of a manual text box)?
In my case I want to add one label at the bottom of the negative bar -> displayed above in the example below as the yscale is reversed).

 採用された回答

Peng Li
Peng Li 2020 年 5 月 9 日

0 投票

using annotation
annotation('textbox', pos, 'String', str, 'FitBoxToText', 'on');
pos is the position where you want to put the textbox in [x, y, width, height], and string is what you want to show.

4 件のコメント

Florian
Florian 2020 年 5 月 9 日
In each plot that I create the errorbars occur on a different position along the x axis. C. How can I specify 'pos' so it coincides with the right vertical and horizontal position relative to an error bar?
Peng Li
Peng Li 2020 年 5 月 9 日
When you create the errorbar, you have x, y, and lower and upper values. you can try to take advantage of these numbers. For example, you can always give an offset of each y-lower by using y-lower-5 for example as the y of your annotation. similarly you can give an offset for x as well and use it for your x of your annotation. you can use a fixed width and height.
Florian
Florian 2020 年 5 月 9 日
That's right. Thanks!
Peng Li
Peng Li 2020 年 5 月 9 日
Glad to be of help!

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

その他の回答 (0 件)

カテゴリ

質問済み:

2020 年 5 月 9 日

コメント済み:

2020 年 5 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by