DisplayFunction is an option for most graphics functions, and is normally used to indicate whether the graphics should be displayed.  As long as you haven't changed the value assigned to $DisplayFunction you can ensure graphics are displayed by giving DisplayFunction the setting $DisplayFunction.  To prevent the display of graphics DisplayFunction should be set to Identity.

For example the next cell shows a plot sin[x], x-(x^3)/6 on the same graphic, but before making the combined plot it makes and displays the individual plots.

plt1 = Plot[Sin[x], {x, -π, π}] ; plt2 = Plot[x - x^3/6, {x, -2, 2}] ; Show[plt1, plt2] ;

You can supress display of the individual plots by using the DisplaFunction options in the next cell.  Here DisplayFunctionIdentity prevents display of the individual graphs.  To ensure the combined plots are displayed we must use DisplayFunction$DisplayFunction inside Show.

plt1 = Plot[Sin[x], {x, -π, π}, DisplayFunctionIdentity] ; plt2 = Plot[x - x ... }, DisplayFunctionIdentity] ; Show[plt1, plt2, DisplayFunction$DisplayFunction] ;

A labor saving way to change the setting of DisplayFunction is given in my discussion of Block.

Created by Mathematica  (May 16, 2004)

Back to Ted’s Tricks index page