필터 지우기
필터 지우기

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

조회 수: 4 (최근 30일)
Doron Ben Shachar
Doron Ben Shachar 2021년 12월 15일
답변: Chunru 2021년 12월 15일
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

답변 (1개)

Chunru
Chunru 2021년 12월 15일
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

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by