add text to plot after several other plots

1 回表示 (過去 30 日間)
ga rec
ga rec 2019 年 8 月 12 日
回答済み: Abhilash Padma 2019 年 8 月 16 日
Is it possible to add a text to a plot after several other plots in matlab live script?
Example:
P0 = plot(x0,y0)
...
P3 = plot(x3,y3)
and now: how to add a text to plot P0???

回答 (1 件)

Abhilash Padma
Abhilash Padma 2019 年 8 月 16 日
Text can be a member of axis and can’t be a member of plot(line). If you have the coordinates for the text, you can add text to the axes anywhere. In your case, it is possible to add a text for P0. See the example below:
hold on;
p0=plot(1:10);
p1=plot(sin(1:10));
p2=plot(cos(1:10));
text(4,4,'text');
For more information, refer the following link: https://www.mathworks.com/help/matlab/ref/text.html

カテゴリ

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