Filter löschen
Filter löschen

small numbers in the legend

3 Ansichten (letzte 30 Tage)
Luca Re
Luca Re am 29 Sep. 2023
Bearbeitet: Voss am 29 Sep. 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.

Akzeptierte Antwort

Voss
Voss am 29 Sep. 2023
Bearbeitet: Voss am 29 Sep. 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.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by