Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

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


  • Prev by Date: Re: Casting a Command as a String
  • Next by Date: Re: simple question about random
  • Previous by thread: Re: Re: Casting a Command as a String
  • Next by thread: Re: Casting a Command as a String