What is the quickest way to disable TeX markup from displaying in messages in a waitbar
? I was expecting an option like
'Interpreter', 'none', ...
What is the quickest way to disable TeX markup from displaying in messages in a waitbar
? I was expecting an option like
'Interpreter', 'none', ...
The Interpreter
property is not available for figures I believe (waitbar
creates a figure object), but you can apply it afterward to the waitbar message:
h=waitbar(x,message);
set(findall(h,'type','text'),'Interpreter','none');
You could also escape the problematic characters, but that would be a lot more complicated.
You can also set the global Tex Interpreter to None
, it applies to waitbars as well.
set(0, 'DefaulttextInterpreter', 'none');
Instead of searching for the object one might change the interpreter directly with the 'dot-notation' (available since R2014b) as in the following MWE:
wb = waitbar(0/10,'My_waitbar_string_with_underscores');
wb.Children.Title.Interpreter = 'none';
for i = 1:10
waitbar(i/10,wb,'My_waitbar_string_with_underscores');
pause(1);
end
delete(wb);
Which changes the interpreter for the title of the axis that is placed inside the waitbar.
Note that if you use a cancel button in the waitbar, the number of children of the object changes and one might have to change
wb.Children.Title.Interpreter
to
wb.Children(2).Title.Interpreter
© 2022 - 2024 — McMap. All rights reserved.