Arbitrarily formatted text in plot labels
- To: mathgroup at smc.vnet.net
- Subject: [mg79240] Arbitrarily formatted text in plot labels
- From: Gareth Russell <russell at njit.edu>
- Date: Sat, 21 Jul 2007 04:40:12 -0400 (EDT)
Hi,
v6!
I often find myself wanting to do the following: I have generated a
matrix of plots by using Table with two variables that affect the
content of the plot. The variables are NOT the counters in the Table
command, but are rather drawn from lists that are indexed by the Table
counters. For example
sList = {1.0, 1.2, 1.5};
rList = {0.5, 0.6, 1.0};
Table[makeMyPlot[sList[[i]],rList[j]]],{i,1,Length[sList]},{j,1,Length[rList]}];
makeMyPlot
can be any kind of plot command. The point is that I want to give each
plot a title (using PlotLabel) that describes the parameters. So for
the upper left plot in the above example, the label should read
"s = 1.0, r = 0.5"
Here's the problem. I want the label to be in 'proper' math format, as
would be generated (for example) by TraditionalForm. In this simple
case, that means the s and the r should be italic, and the whole
expression should be in Times. But I can't for the life of me figure
out how to do it. Using string commands (StringJoin etc.) I can
construct the string, but can't get it to format correctly -- I can't
make the s and r alone be italic. If I use TraditionalForm on the whole
thing I get in trouble because it only works properly on an expression
(rather than a string), but then I have to use Hold to prevent the set
(=) evaluating, but I DO want the sList[[i]] etc. to evaluate. I can't
seem to come up with the right combination. Also, as an expression,
this would be a list, but I don't want the enclosing parentheses.
Any thoughts appreciated.
--
Gareth Russell
NJIT