How to increase the length of the legend line?
192 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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);
Antworten (3)
KALYAN ACHARJYA
am 21 Apr. 2018
Bearbeitet: Walter Roberson
am 8 Sep. 2020
I don't think it is customizable directly, go to the following links to user-defined function-
4 Kommentare
Luca Menegozzo
am 28 Nov. 2020
Bearbeitet: Luca Menegozzo
am 28 Nov. 2020
The best solution to the problem without extra functions. Thank you!
Afiq Azaibi
am 9 Okt. 2024
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 Kommentare
Siehe auch
Kategorien
Mehr zu Legend finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!