Combination of textarrow and textbox

7 ビュー (過去 30 日間)
Timon Rayis
Timon Rayis 2019 年 11 月 11 日
コメント済み: Timon Rayis 2019 年 11 月 11 日
Can we acheive something like this in matlab with text or annotation ?
A combination of textbox and textarrow ?

採用された回答

Turlough Hughes
Turlough Hughes 2019 年 11 月 11 日
編集済み: Turlough Hughes 2019 年 11 月 11 日
You could do the following:
xtip=0.5; ytip=0.5; % arrow tip coordinates (normalized units)
w=0.15; %box width
h=0.1; %box height
offset=0.1;
str=['0.8042 p.u.' char(10) '15:05:20.133'];
x = [xtip-offset xtip]; % arrows start and end coordinates
y = [ytip+offset ytip]; % I've just offset by 0.1 in x and y.
a=annotation('textarrow',x,y,'Color','red');
b=annotation('textbox',[xtip-w-0.1 ytip+0.1 w h],'String',str,'Color','red','EdgeColor','red');
The coordinates here are normalised with respect to your axes limits. For directly specifying coordinates w.r.t the data you used in the plot, like a point on your line, I would look at the following question.
  1 件のコメント
Timon Rayis
Timon Rayis 2019 年 11 月 11 日
Fabulous. Thanks Turlough.

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by