MathGroup Archive 1999

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

Search the Archive

RE: Follow-Up Question to

  • To: mathgroup at
  • Subject: [mg20202] RE: [mg20187] Follow-Up Question to [mg20090]
  • From: "Ersek, Ted R" <ErsekTR at>
  • Date: Wed, 6 Oct 1999 21:06:24 -0400
  • Sender: owner-wri-mathgroup at

A. Hanszen  wrote:
Adam Smith rose the question, why  nodisp in

nodisp = DisplayFunction -> Identity
graph1 = Plot[Sin[2 Pi x],{x,0,2},nodisp]

does not work. From the answers in this group, we learned,
that one either has to wrap nodisp into Evaluate

graph1 = Plot[Sin[2 Pi x],{x,0,2},Evaluate[nodisp]]

or use Block to temporarily deviate DisplayFunction to Identity
and use Show outside the Block-construct to display the combined
graphs or use one or the other package to combine different graphs.

Plot has the Attribute HoldAll. However, if one changes this
to HoldFirst (which might have other unwanted side effects),
Evaluate around nodisp is still necessary. Can anybody in this
group explain, why? It is just a matter of better understanding
Hold and so on, rather than a question of combining graphics 


Below Plot makes the graphic of a Sine wave even though t=3.5.



(* Graphic not shown. *)

Next I change the attributes as you suggest.


Now we the line below doesn't work.

Plot[Sin[t],{t,0,4 Pi}];

  Plot::itraw: Raw object 3.5` cannot be used as an iterator.

In this case Plot[Sin[t],{t,0,4 Pi}] 
evaluated to Plot[Sin[t],{3.5,0, 4 Pi}] which is an invalid input.


Now try my (PlotFunctions.m) package available from .
With this package you never need to use Evaluate inside Plot, and I can
pretty much say it doesn't degrade Plot in any way!

Ted Ersek

For Mathematica tips, tricks see

  • Prev by Date: RE: Drawing Rectangular Grid
  • Next by Date: Re: Follow-Up Question to
  • Previous by thread: Follow-Up Question to
  • Next by thread: Re: Follow-Up Question to