フィルターのクリア

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 Center および File Exchange2-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