Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Superscripts and subscripts in titles

Subject: Superscripts and subscripts in titles

From: Marco Ferrari

Date: 30 Sep, 1998 17:13:02

Message: 1 of 5

Hi,

I was told some time ago about how to write superscripts in graph titles

and labels writing

Normal^{Superscript}

I am using MATLAB 5.0 now, but I don't know whether this is a new
feature for this new release or I just ignored this capability and it
used to be
already available with MATLAB 4.
I looked for some help related to this topic but I couldn't find any.
Does anybody know what topic should I search for?
Basically I'd like to know if there's a similar way to write subscripts
in titles
and labels; does anybody know anything about this as well?
Thanks in advance.


    Marco

Subject: Superscripts and subscripts in titles

From: Chris DiFronzo

Date: 30 Sep, 1998 15:14:02

Message: 2 of 5

Hi Marco,

The superscript and subscripts as well as other TeX characters are new
features in MATLAB 5, and were not available in MATLAB 4.2c.

To get a subscript you must use the underscore "_" character. For
example:

 plot(1:10)
 title('^{super} normal _{sub}')

You can also see a complete list of all the TeX characters that MATLAB
currently supports in the MATLAB Helpdesk.

To get to the Helpdesk just type "helpdesk" at the MATLAB prompt. Your
web browser will be launched and the main Helpdesk page will be open.

Then click on the "Handle Graphics Objects" link that is in the MATLAB
Topics area (upper left).

You will then see the graphics hierarchy at the top of the page. Click
on "Text" (lower right)

Now you will see all of the text properties in a frame on the left side
of the window. In that frame click on the "String" link and you will see
all of the supported TeX characters.

Good Luck,

Chris Di Fronzo
difronzo@mathworks.com

Marco Ferrari wrote:
>
> Hi,
>
> I was told some time ago about how to write superscripts in graph titles
>
> and labels writing
>
> Normal^{Superscript}
>
> I am using MATLAB 5.0 now, but I don't know whether this is a new
> feature for this new release or I just ignored this capability and it
> used to be
> already available with MATLAB 4.
> I looked for some help related to this topic but I couldn't find any.
> Does anybody know what topic should I search for?
> Basically I'd like to know if there's a similar way to write subscripts
> in titles
> and labels; does anybody know anything about this as well?
> Thanks in advance.
>
> Marco

Subject: Superscripts and subscripts in titles

From: anitav@merle.acns.nwu.edu (Anita Vasavada)

Date: 6 Oct, 1998 10:14:31

Message: 3 of 5

In article <361282FA.3E9B@mathworks.com>, Chris DiFronzo
<difronzo@mathworks.com> wrote:

> Hi Marco,
>
> The superscript and subscripts as well as other TeX characters are new
> features in MATLAB 5, and were not available in MATLAB 4.2c.
>
> To get a subscript you must use the underscore "_" character. For
> example:
>
> plot(1:10)
> title('^{super} normal _{sub}')
>

I have the opposite problem: What if there is an underscore in the text
of the title? Matlab 5 will make subscripts. Is there any way to get
around that?

Thanks,
Anita Vasavada
anitav@merle.acns.nwu.edu

Subject: Superscripts and subscripts in titles

From: MikeRenfro@bigfoot.com (Mike Renfro)

Date: 6 Oct, 1998 16:46:09

Message: 4 of 5

On Tue, 06 Oct 1998 10:14:31 -0500, anitav@merle.acns.nwu.edu (Anita
Vasavada) wrote:

>In article <361282FA.3E9B@mathworks.com>, Chris DiFronzo
><difronzo@mathworks.com> wrote:
>> To get a subscript you must use the underscore "_" character. For
>> example:
>>
>> plot(1:10)
>> title('^{super} normal _{sub}')
>I have the opposite problem: What if there is an underscore in the text
>of the title? Matlab 5 will make subscripts. Is there any way to get
>around that?

Just like C, prefix it with a backslash, for example:

title('x\_y_2')

Will preserve the first underscore, but turn the second one into a
subscript operator.

Subject: Superscripts and subscripts in titles

From: francis.favorini@NOSPAMduke.edu (Francis Favorini)

Date: 7 Oct, 1998 18:22:22

Message: 5 of 5

In article <anitav-0610981014310001@165.124.30.78>, anitav@merle.acns.nwu.edu
says...
>I have the opposite problem: What if there is an underscore in the text
>of the title? Matlab 5 will make subscripts. Is there any way to get
>around that?

Change the text Interpreter property to 'none' instead of 'tex'.
text(1,1,'_test','Interpreter','none');

or if you already created the text:
set(hText,'Interpreter','none');

Or you can set the default that way for the current figure or all figures:
set(gcf,'DefaultTextInterpreter','none');
set(0,'DefaultTextInterpreter','none');

-Francis

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us