Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Subscript in AxesLabel

943 views
Skip to first unread message

atlas shrugger

unread,
Jul 24, 2010, 5:06:23 AM7/24/10
to
Hi,

Please teach me to put subscript in AxesLabel. I have 3D plot command
ListPlot3D[..., AxesLabel->{}]. I want label to look like in LaTeX
"u_k(x_1(s),t)" but I receive only various error messages when I try
to put this to Mathematica.

Many thanks for help in advance.

Best regards,
A. S.


telefunkenvf14

unread,
Jul 25, 2010, 1:58:51 AM7/25/10
to

Type:

(1) PlotLabel -> and then hit Ctrl+9, (*This creates an inline cell*)
(2) followed by u Ctrl+-
(3) followed by (x Ctrl+- 1 (s),t)

With the method above you do NOT need to enclose it in " ".

However, if you hadn't created an inline cell, and merely typed in
u_k(x_1(s),t) (*using the appropriate shortcuts for subscripts, of
course*), then Mathematica would treat this as StandardForm[] input
(notice the coloring?), causing the () in your expression confuse the
program. (Why? Mathematica is expecting [] for functions) To fix this,
you could alternatively just make it a string, i.e., wrap the label in
"".

I prefer the inline cell method.

-RG

Simon

unread,
Jul 25, 2010, 1:59:02 AM7/25/10
to
Hi A.S,

Maybe this might help: Try running

In[1]:= expr1=ToExpression["u_k(x_1(s),t)",TeXForm]

In[2]:= expr2=ToString[expr1,TraditionalForm]

In[3]:= Plot[x,{x,0,1},AxesLabel->{expr1,expr2}]

J. Batista

unread,
Jul 25, 2010, 1:59:45 AM7/25/10
to

Here is a possible solution. When you append the AxesLabel option to the
end of your ListPlot3D command line, you should place your label for each
individual axis in quotation marks (i.e. AxesLabel -> {"Label 1", "Label
2"}). This will indicate to Mathematica to treat the labels as text
strings. Now, to achieve subscripts in your labels, simply use the
subscript icon at the bottom of the Basic Math Input palette. While this
may be sufficient for your needs, if you wish to alter the final appearance
of the labels, you may highlight the label text within the quotation marks
and use the Format drop-down menu to alter properties such as font, size,
and color of the selected text.

Best Regards,
J. Batista

0 new messages