How to increase the length of the legend line?
193 ビュー (過去 30 日間)
古いコメントを表示
Hello, I would like to increase the length (not linewidth) of the line inside the legend. Does anyone has an idea? Thanks you.
t = [0:0.1:2*pi]
a = sin(t);
b = cos(t);
plot(t,a,t,b,'linewidth',3)
l = legend({'Sinus','Cosinus'},...
'location','southwest','FontName','TimesNewRoman','FontSize',20);
回答 (3 件)
KALYAN ACHARJYA
2018 年 4 月 21 日
編集済み: Walter Roberson
2020 年 9 月 8 日
I don't think it is customizable directly, go to the following links to user-defined function-
4 件のコメント
Luca Menegozzo
2020 年 11 月 28 日
編集済み: Luca Menegozzo
2020 年 11 月 28 日
The best solution to the problem without extra functions. Thank you!
Afiq Azaibi
2024 年 10 月 9 日
Starting in R2024b, you can leverage the IconColumnWidth property on legend to increase the length of the line:
t = [0:0.1:2*pi]
a = sin(t);
b = cos(t);
plot(t,a,t,b,'linewidth',3)
l = legend({'Sinus','Cosinus'},...
'location','southwest','FontName','TimesNewRoman','FontSize',20);
l.IconColumnWidth = 60;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Legend についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!