MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

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 |
\*------------------------------*/


  • Prev by Date: Re: How to plot individual 2D data points, where each must have its own color.
  • Next by Date: Re: Freeware Mathematica packages(don't know the exact term)
  • Previous by thread: Re: Casting a Command as a String
  • Next by thread: Re: Casting a Command as a String