Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

RE: Preventing plotting on output

  • To: mathgroup at
  • Subject: [mg20123] RE: [mg20090] Preventing plotting on output
  • From: "Ersek, Ted R" <ErsekTR at>
  • Date: Sat, 2 Oct 1999 03:04:52 -0400
  • Sender: owner-wri-mathgroup at

Adam Smith wrote:
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]


There are a couple of ways to approach this.  First you can download my
PlotFunctions package from:

Then you can load my package (as I show below) and the method you tried will
work!  Besides that my package makes it so you never need to use Evaluate
inside Plot, Plot3D, ParametricPlot, ContourPlot, DensityPlot or Play, and
your plots will always come out right.  Sounds nice doesn't it?


graph1=Plot[Sin[2 Pi x],{x,0,2},nodisp];
graph2=Plot[Sin[4 Pi x],{x,0,2},nodisp];

(* graphic not shown *)

Block can also be useful for this sort of thing.  The following is an
example from the discussion of Block on my web site (the URL is given

  p2=Plot[Sin[2 t],{t,0,\[Pi]/2}];
  p3=Plot[Sin[3 t],{t,0,\[Pi]/2}];
  p4=Plot[Sin[4 t],{t,0,\[Pi]/2}];

(* Graphic not shown. *)

I expect Dave Park will use this as a chance to pitch his DrawingPaper
package since it's another way to avoid that damn option DisplayFunction.
You can find Dave's package at

Ted Ersek

For Mathematica tips, tricks see

  • Prev by Date: Re: Re: List-Selection
  • Next by Date: Re: Preventing plotting on output
  • Previous by thread: Re: Preventing plotting on output
  • Next by thread: Re: Preventing plotting on output