small numbers in the legend
4 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
Voss
on 29 Sep 2023
Edited: Voss
on 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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!