Effacer les filtres
Effacer les filtres

Adding a label with text on a plot

12 vues (au cours des 30 derniers jours)
HC98
HC98 le 28 Fév 2024
Réponse apportée : Chunru le 28 Fév 2024
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?

Réponse acceptée

Chunru
Chunru le 28 Fév 2024
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

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by