title('string1_string2'): Stop automatic subscripts?
85 ビュー (過去 30 日間)
古いコメントを表示
I have a code that goes through many files and creates many plots that I distribute to different users. The plots are automatically titled (thank the heavens) to be whatever the file name is using the simple title() command.
Almost all of the files have an underscore in there somewhere, but it is never consistent.
'file_23', 'data_is_here', 'test_v13'
While it is not critical, its quite annoying that the title() command automatically wants to automatically assume that it should not print the underscore, but instead print the next letter as a tiny subscript.
Is there a way to disable this automatic feature? I want to print the underscore rather than make a subscript, however it is not practical for me to try to replace all the underscores with '\_'.
Just wondering if its something easy to disable.
0 件のコメント
採用された回答
Image Analyst
2014 年 10 月 8 日
You have to set the interpreter to 'none' . Not sure the others knew of this or remembered it. But let's say that your file name has an under line in it and you want to see the underline. Simply do
title(filename, 'Interpreter', 'none');
Now the character after the underline will not be a subscript. It is documented in the title() documentation though it may not be so obvious.
その他の回答 (2 件)
Star Strider
2014 年 10 月 8 日
‘it is not practical for me to try to replace all the underscores with '\'.’_
It can be. Use strrep:
ttls = {'file_23', 'data_is_here', 'test_v13'};
ttlsr = strrep(ttls, '_', '\_');
produces:
ttlsr =
'file\_23' 'data\_is\_here' 'test\_v13'
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Subplots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!