Azzera filtri
Azzera filtri

small numbers in the legend

3 visualizzazioni (ultimi 30 giorni)
Luca Re
Luca Re il 29 Set 2023
Modificato: Voss il 29 Set 2023
leg =
3×1 cell array
{'1-Preset1- ==>0 $' }
{'2-Preset1_1- ==>0 $'}
{'3-Preset1_2- ==>0 $'}
leg=compose('%s',strArr(ii));
legend(Ax_Eq,leg,'Location','northwest');
hi,it'a possible to draw size normal?
Invalid expression. Check for missing or extra characters.

Risposta accettata

Voss
Voss il 29 Set 2023
Modificato: Voss il 29 Set 2023
The default text interpreter, tex, is interpreting the underscores as subscripts, so you can either:
(1) escape the underscores with backslashes
figure
Ax_Eq = axes();
plot(magic(3));
leg = { ...
'1-Preset1- ==>0 $'; ...
'2-Preset1\_1- ==>0 $'; ...
'3-Preset1\_2- ==>0 $'};
legend(Ax_Eq,leg,'Location','northwest')
or (2) change the interpreter to 'none'
figure
Ax_Eq = axes();
plot(magic(3));
leg = { ...
'1-Preset1- ==>0 $'; ...
'2-Preset1_1- ==>0 $'; ...
'3-Preset1_2- ==>0 $'};
legend(Ax_Eq,leg,'Location','northwest','Interpreter','none')
Option 2 is probably easier in this case.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by