Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
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

Respuestas (1)

Chunru
Chunru el 15 de Dic. de 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

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by