How to change font size and location in a mask icon?

27 views (last 30 days)
I would like to change font size and location in a mask. I found an answer here
disp('{\bf\fontsize{12}Label Text}', 'texmode','on');
but how to apply this to my case if I have some values to display
eg.
disp(str);
str=sprintf('PI controller\n\nLimit = %g / %g', UpperLimit, LowerLimit);
UpperLimit and LowerLimit are defined as mask parameters and the mask is automatically updated when new values are applied.
disp(str, 'texmode','on')
This works, but not sure how to change font size and make it bold/italics. Or if I want to have part of the text bold (e.g PI Controller) and Limit with smaller font.

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 1 Oct 2022
You can try gtext() or text(), e.g.:
gtext(['This is awesone ' date], 'fontsize', 15, 'backgroundcolor', 'y')
%% OR
text(1, 1, ['This is awesone ' date], 'fontsize', 15, 'backgroundcolor', 'y')

Tags

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!