Effacer les filtres
Effacer les filtres

How to display index/name for each curve when using hold on for plotting?

4 vues (au cours des 30 derniers jours)
Doron Ben Shachar
Doron Ben Shachar le 15 Déc 2021
Réponse apportée : Chunru le 15 Déc 2021
Hello,
I'm trying to plot multiple curves in a single figure, but also i wish to add small label near each curve. Any help?
Thanks
while(i<pedons(1,end))
switch true
case (pedons(i,5)==1)
figure(1)
plot(nPedons(1:100,i),1:100,'r')
xlabel('Calcium Carbonate'), ylabel('depth[cm]')
axis([0 100 0 100])
title('Soil Profile 1')
hold on
% ....... etc
end
i=i+1;
end

Réponses (1)

Chunru
Chunru le 15 Déc 2021
while(i<pedons(1,end))
switch true
case (pedons(i,5)==1)
figure(1)
plot(nPedons(1:100,i),1:100,'r')
%%%%%%%%%%%%%%
text(nPedons(100,i), 100, "1"); % you may want to right aligned
%%%%%%%%%%%%%%
xlabel('Calcium Carbonate'), ylabel('depth[cm]')
axis([0 100 0 100])
title('Soil Profile 1')
hold on
% ....... etc
end
i=i+1;
end

Catégories

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

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by