How to specify a legend using pre-determinate matrix
古いコメントを表示
Hi; I want to specify a legend making use of a predefined matrix. for example, I construct matrix TP based on some selections, then plots have been constructed. After I want to use TP to specify my legend. I tried do it like the following:
for i=1:e
LG(1,i)=num2str(TP{i})
end
legend LG
回答 (2 件)
Star Strider
2017 年 1 月 23 日
Try this:
legend(LG)
2 件のコメント
Alaa Hameed
2017 年 1 月 23 日
Star Strider
2017 年 1 月 24 日
Without seeing the rest of your code, I cannot determine the problem.
Geoff Hayes
2017 年 1 月 23 日
Alaa - please make sure that your LG is a cell array as per the documentation at legend. For example,
LG = cell(1,n);
for k=1:n
LG {1,k} = ...;
end
カテゴリ
ヘルプ センター および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!