Adding a label with text on a plot

조회 수: 2 (최근 30일)
HC98
HC98 2024년 2월 28일
답변: Chunru 2024년 2월 28일
I have a plot of some data and I want to highlight one of its distinct peaks like this:
Is there any way that I can do this?

채택된 답변

Chunru
Chunru 2024년 2월 28일
x = -3:.1:3
x = 1x61
-3.0000 -2.9000 -2.8000 -2.7000 -2.6000 -2.5000 -2.4000 -2.3000 -2.2000 -2.1000 -2.0000 -1.9000 -1.8000 -1.7000 -1.6000 -1.5000 -1.4000 -1.3000 -1.2000 -1.1000 -1.0000 -0.9000 -0.8000 -0.7000 -0.6000 -0.5000 -0.4000 -0.3000 -0.2000 -0.1000
y = exp(-(x-0.5).^2/2);
plot(x, y)
% need to adjust the coordinates (normalized unit)
% doc annotation for more details
annotation("doublearrow", [0.58 0.58], [0.12 0.93]);
text(0.5, 0.4, "a", "Color", "r") % data unit

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by