Disabling printing underscore as subscript in figures

조회 수: 373 (최근 30일)
AP
AP 2011년 6월 11일
댓글: Eliot 2025년 4월 16일
Underscores print as subscript in figures. Can I disable it because I want to print the underscores as well.
Thanks.
  댓글 수: 2
Michael Marcus
Michael Marcus 2019년 4월 11일
편집: Stephen23 2019년 4월 11일
Although this allows underscores to print, it does not allow special symbols such as \mum to work.. Does anyone know how to allow both.
Mike Marcus
Michael Marcus
Michael Marcus 2019년 4월 11일
I did find out another way to keep the underscore. \_ does work ? I have answered my own question? Convert all underscores in the text to \_ instead of changing the interpreter to none.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 11일
편집: Image Analyst 2018년 1월 17일
Set the Interpreter property for that field to 'none'; the default for text() fields is LaTex.
title('This_title has an underline', 'Interpreter', 'none'); % Also works with xlabel() and ylabel()
  댓글 수: 13
Yulong Li
Yulong Li 2023년 5월 9일
@Walter Roberson got it, thanks!
Eliot
Eliot 2025년 4월 16일
Thank you for this easy solution to my messed-up plot titles!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

HE
HE 2020년 5월 5일
If you are using sprintf, \\_ should work for you.
old_cells = sprintf('Old cells: Y = %3.3f (X) \\^ %1.3f',coefs_old);
young_cells = sprintf('Young cells: Y = %3.3f (X) \\^%1.3f',coefs_young);

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by