MathGroup Archive 2008

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

Search the Archive

Re: Convert to Expression

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86471] Re: Convert to Expression
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Wed, 12 Mar 2008 00:11:43 -0500 (EST)
  • References: <fr5e6d$obc$1@smc.vnet.net>

Namrata Khemka wrote:
> Hi everyone,
> I have a question regarding using "Show Expression".
> If you select a cell and then go to "Format" -> Show Expression.
> For  example:
> Plot[x, {x, 1, 3}]
> 
> Selecting the cell and going to format->Show Expression one gets:
> Cell[BoxData[
>      RowBox[{"Plot", "[",
>        RowBox[{"x", ",",
>          RowBox[{"{",
>            RowBox[{"x", ",", "1", ",", "3"}], "}"}]}],
>        "]"}]], "Input"]
> 
> 
> Is there a command to get this Expression that one can type in instead
> of using the menu bar?
> 
> Thanks very much,
> Namrata Khemka
> 
> 

I am guessing that you are looking for something that you can use within 
a program:

ToBoxes[Unevaluated[Plot[x, {x, 1, 3}]]]

Note that the Unevaluated wrapper is required in order to stop the 
command evaluating. If you want to see the result of the evaluation, 
leave this wrapper off. The output from ToBoxes does not include the 
Cell wrapper, so you can add that if you require it.

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Non-Linear Graphics Scaling
  • Next by Date: ResetMenusPacket
  • Previous by thread: Re: Convert to Expression
  • Next by thread: Re: Convert to Expression