フィルターのクリア

How can I show some properties of specific points on the plots

1 回表示 (過去 30 日間)
Mitra Taghizadeh
Mitra Taghizadeh 2023 年 3 月 14 日
回答済み: Praveen Reddy 2023 年 4 月 13 日
I have some points that I plot them. Each point represents a specefic number. I want to show those numbers on the plot. How can I do this work.

回答 (1 件)

Praveen Reddy
Praveen Reddy 2023 年 4 月 13 日
Hi Mitra,
I understand that you want to label some points in a plot. You can label the points using “text” function. Below is an example where some points are labelled with their corresponding y-value.
x = linspace(0,3*pi,10);
y = cos(x) + rand(1,10);
scatter(x,y)
text(x(1,2),y(1,2),string(y(1,2)));
text(x(1,6),y(1,6),string(y(1,6)));
text(x(1,9),y(1,9),string(y(1,9)));
To know more about “text” function, please refer to the following MATLAB documentation:

カテゴリ

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

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by