MathGroup Archive 1999

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

Search the Archive

Re: Preventing plotting on output

  • To: mathgroup at
  • Subject: [mg20127] Re: Preventing plotting on output
  • From: "Atul Sharma" <atulksharma at>
  • Date: Sat, 2 Oct 1999 03:04:55 -0400
  • References: <7suv5r$>
  • Sender: owner-wri-mathgroup at

One of the more elegant solutions, from Ted Ersek's very handy collection of
Mathematica Tricks available from his website at, uses the Block structure to
assign a local value to $DisplayFunction and then Show outside of the Block,
where DisplayFunction has it's default value:


Block[{$DisplayFunction = Identity},
graph1 = Plot[Sin[2 Pi x],{x,0,2}] ;
graph2 = Plot[Sin[4 Pi x],{x,0,2}]

Show[graph1, graph2]

A. Sharma (with thanks to Ted for this and other useful pointers)

  Show[graph1, graph2]
adam.smith at wrote in message <7suv5r$21s at>...
>I know I could find the answer to this if I looked hard enough through
>the Help and/or Manual, but I am certain one of the experts out there
>will have the solution immediately.
>I want to construct some plots and then display them combined on one
>graph.  The Plot[] for each individual plot is fairly lengthy and I was
>hoping to save some space by replacing the "DisplayFunction->Identity"
>with a single word like "nodisp".  In the final Show[] I would then
>turn the display back on with the
>usual "DisplayFunction>$DisplayFunction" (maybe even equate it with a
>single term like "disp").
>Here is a simplified example of what I quickly tried without success
>nodisp = DisplayFunction -> Identity
>graph1 = Plot[Sin[2 Pi x],{x,0,2},nodisp]     Error messages show up
>graph2 = Plot[Sin[4 Pi x],{x,0,2},nodisp]
>Show[{plot1,plot2},DisplayFunction -> $DisplayFunction]
>I realize I could use SetOptions[] to temporarily turn off and turn on
>display, but defining nodisp seems more natural and intuitive to me.
>Adam Smith
>Sent via
>Before you buy.

  • Prev by Date: RE: creating input cell with unevaluated expression?
  • Next by Date: Re: Preventing plotting on output
  • Previous by thread: Re: Preventing plotting on output
  • Next by thread: Re: Preventing plotting on output