MATLAB Answers


Disabling printing underscore as subscript in figures

Asked by AP
on 11 Jun 2011

Underscores print as subscript in figures. Can I disable it because I want to print the underscores as well.





No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 11 Jun 2011
 Accepted answer

Set the Interpreter property for that field to 'none'; the default for text() fields is LaTex.


Walter Roberson
on 11 Jun 2011

Personally I never count on gco being the object I am interested in.

In the above, gco is likely to be the result of imshow(), but imshow() returns an image object, and image objects do not have a 'text' field.

When you title(), a _new_ text object is created to hold the title. That new text object is not going to inherit the properties of the old one.

I would suggest,

for i = 1:4
title(sprintf('%s_%d',mytitle{i},i), 'Interpreter', 'none');

on 11 Jun 2011

You're the best. Thanks.

Jan Simon
on 11 Jun 2011

Another method: Replace '_' by '\_' in the string.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!