Re: Casting a Command as a String
- To: mathgroup at smc.vnet.net
- Subject: [mg58951] Re: [mg58940] Casting a Command as a String
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Mon, 25 Jul 2005 01:12:07 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
Needs["DiscreteMath`Combinatorica`"];
X={"Cycle[4]","CompleteGraph[3]"};
ShowGraph[ToExpression[#],PlotLabel->#]&/@X;
or
Scan[ShowGraph[ToExpression[#],PlotLabel->#]&,X];
Bob Hanlon
>
> From: Bruce Colletti <vze269bv at verizon.net>
To: mathgroup at smc.vnet.net
> Date: 2005/07/24 Sun AM 01:21:59 EDT
> Subject: [mg58951] [mg58940] Casting a Command as a String
>
> I have a list of (Combinatorica) graphs (e.g., X =
{Cycle@4,CompleteGraph@3}), and want to automatically display each with
the command as the display title.
>
> For instance, manually working the above list:
>
> ShowGraph[Cycle@4, PlotLabel->?Cycle@4?];
> ShowGraph[CompleteGraph@3,PlotLabel->?CompleteGraph@3?];
>
> How do I automate this for an arbitrary list of (Combinatorica) graphs?
Although Scan[ShowGraph,X] displays the titleless graphs, I can?t figure out
how to cast a command as a string (so that it can become a title).
>
> Thanks.
>
> Bruce
>
>
Bob Hanlon
Chantilly, VA