small numbers in the legend

3 次查看(过去 30 天)
Luca Re
Luca Re 2023-9-29
编辑: Voss 2023-9-29
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.

采纳的回答

Voss
Voss 2023-9-29
编辑:Voss 2023-9-29
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by