How do I mark a specific point on a graph?

23 ビュー (過去 30 日間)
Hyoeun Kim
Hyoeun Kim 2021 年 5 月 2 日
回答済み: DGM 2021 年 5 月 2 日
Hello,
I need help with this figure here, I want to mark two points, y(t) = 0.14 and 0.441, and the box with x,y values next to them
what code do I need to add? Thank you in advance!

回答 (1 件)

DGM
DGM 2021 年 5 月 2 日
You could do this using text() and a bunch of other wrangling, or you could just use datatip():
x = linspace(0,1,100);
f = x.^2;
h = plot(x,f); grid on;
datatip(h,x(50),f(50),'location','southeast');
datatip(h,x(70),f(70),'location','northwest');

カテゴリ

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