Azzera filtri
Azzera filtri

How to increase the length of the legend line?

137 visualizzazioni (ultimi 30 giorni)
Felix
Felix il 21 Apr 2018
Commentato: xuewei li il 25 Mar 2022
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);

Risposte (2)

KALYAN ACHARJYA
KALYAN ACHARJYA il 21 Apr 2018
Modificato: Walter Roberson il 8 Set 2020
  4 Commenti
Luca Menegozzo
Luca Menegozzo il 28 Nov 2020
Modificato: Luca Menegozzo il 28 Nov 2020
The best solution to the problem without extra functions. Thank you!

Accedi per commentare.


xuewei li
xuewei li il 25 Mar 2022
leg = legend('1','2','3');
leg.ItemTokenSize = [x1,x2];

Community Treasure Hunt

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

Start Hunting!

Translated by