FW: AW: LogPlot/Plot-Identity

• To: mathgroup at smc.vnet.net
• Subject: [mg27144] FW: AW: [mg27041] LogPlot/Plot-Identity
• From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.de>
• Date: Wed, 7 Feb 2001 02:12:49 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Dear Hartmut,

One question. Is Identity from plot or is it the Identity function?

g2a = Block[{\$DisplayFunction}, Identity @@ LogPlot[Exp[3 t], {t, 0, 5}]]

is different from

Block[{\$DisplayFunction}, Identity[LogPlot[Exp[3 t], {t, 0, 5}]]]

Why is this?

Thank you

Bernd

---------------------------------
Dear Bernd,

yes, Identity is the built-in Mathematica identity function. Now, how does
it work together with Plot? We first have to understand, how that works
(explore the Help function, at Display, DisplayFunction, and esp. Section
2.9.14.): for short, there are two processing steps implied. First, a
graphical object will be constructed, containing all the primitives that
make up the picture, lines, axes, tick marks etc. Then, second, the graphics
have to be rendered. This is where the display function comes into play: the
graphical objects are converted (normally to Mathematica PostScript, if you
don't specify otherwise) *and then sent to the Mathematica frontend*. This
is done such by all Plot functions, and Show, everything is wrapped into the
display function, that is the current value of the symbol \$DisplayFunction
(in the System` context) by default, which again normally is
Display[\$Display, #1]&. So if you write

(*1*)    Block[{\$DisplayFunction=Identiy}, -some plot-]

then finally Indentiy is wrapped over the graphical object, which just
reproduces this graphical object. So far so good.

The display function the plotting functions,Plot, LogPlot etc. use, is given
by the option DisplayFunction (which as told above) has the default value
\$DisplayFunction.

Therefore if you write

(*2*)    Plot[-something- , DisplayFunction -> Identity]

The final result is the same, *except* that now that option has also been
inserted into the resulting graphical object.

Now if you use Show on a graphical object, the value of the option
DisplayFunction of that graphical object is used, and such

Show[-result of (*2*)-]

won't work. This option however may be overridden by supplying a directive
to Show

Show[-result of (*2*)- ,DisplayFunction -> \$DisplayFunction]

Now in the expression (*1*) for the built-in function Plot, the symbol
\$DisplayFunction is not used (not evaluated) internally, and such the
resultant object has the Option DisplayFunction :> \$DisplayFunction (regard
RuleDelayed!)

However not neccessarily so with user written or supplied plotting
functions. There, whenever during processing the symbol \$DisplayFunction
gets evaluated (accidentially perhaps), then Identity is assigned to the
option DisplayFunction. This is what happens with LogPlot (a library
function). Now if you use my proposed form

(*3*)   Block[{\$DisplayFunction}, Identity @@ -a plot- ]

Then \$DisplayFunction has no spurious value which can be passed to the
resulting graphical object. And Identiy applied to the final result replaces
the wrapper (the display function) of the graphical object, very much as in

Identity @@ Hold[1 + 2]

Now why does this work with Display? Within Block the final wrapper is
\$DisplayFunction, an undefined symbol, not able to evaluate, so Apply has
the chance to Replace it by Identity.

yours, Hartmut

```