Re: Re: Casting a Command as a String
- To: mathgroup at smc.vnet.net
- Subject: [mg58969] Re: [mg58962] Re: Casting a Command as a String
- From: stephen layland <layland at wolfram.com>
- Date: Tue, 26 Jul 2005 04:01:35 -0400 (EDT)
- References: <dbv9og$efo$1@smc.vnet.net> <200507250512.BAA04846@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
and thus spake ggroup at sarj.ca [2005.07.25 @ 00:37]:
> Hi Bruce,
>
> Can you modify your routine to do something like the following?
>
> x = {
> Hold[Plot[Sin[x], {x, 0, 2*Pi}]],
> Hold[Plot[Cos[x], {x, 0, 2*Pi}]]
> };
> y = Table[
> ToString[x[[i]]] // StringDrop[#, 5] & // StringDrop[#, -1] &, {i,
> \
> Length[x]}]
> x1 = ReleaseHold[x];
> Table[Show[x1[[i]], PlotLabel -> y[[i]]];, {i, Length[x1]}];
Hrm. I think a simple Hold function will do the trick a lot easier:
SetAttributes[f,HoldAll];
f[x_] := ShowGraph[x, PlotLabel -> ToString[HoldForm@x]]
--
/*------------------------------*\
| stephen layland |
| Documentation Programmer |
| http://members.wri.com/layland |
\*------------------------------*/
- References:
- Re: Casting a Command as a String
- From: ggroup@sarj.ca
- Re: Casting a Command as a String