MathGroup Archive 1999

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

Search the Archive

Re: Supressing Plot Output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16435] Re: Supressing Plot Output
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sat, 13 Mar 1999 02:21:46 -0500
  • References: <7c59gj$7n3@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Benjamin Rahn wrote in message <7c59gj$7n3 at smc.vnet.net>...
>How can I overlay plots and graphics primitives _without_ displaying the
>individual plots first?
>
>For example, I have a function that creates a plot of a spiral based
>on three points in the plane:
>
>Spiral[A_,B_,C_]:=Module[ ...
> ...;
> ParametricPlot[...] ];
>
>The function Spiral[] immediately generates the spiral, so the
>command
>
>Show[Spiral[P,Q,R],Graphics[Line[{P,Q,R,P}]]];
>
>gives two outputs: an image of the spiral by itself, and an image of the
>spiral with the overlaid triangle.  How can I restrict the output to the
>second image?
>
>Thanks!
>
>-Ben
>
>

Ben:
Two general ways

1) Using the option DisplayFunction -> Identity with Plot

Spiral[A_,B_,C_]:=Module[ ...
 ...;
 ParametricPlot[...,DisplayFunction -> Identity ] ];

Then turn the display back on with Show:

Show[Spiral[P,Q,R],Graphics[Line[{P,Q,R,P}]],DisplayFunction ->
$DisplayFunction];


2) *Temporarily* cancel display using Block

Spiral[A_,B_,C_]:=Module[ ...
 ...;
Block[{ $DisplayFunction =Identity},ParametricPlot[... ] ]

];

Then simply use show

Show[Spiral[P,Q,R],Graphics[Line[{P,Q,R,P}]]];

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565





  • Prev by Date: Integral problem
  • Next by Date: Re: planar polygon plot
  • Previous by thread: Re: Supressing Plot Output
  • Next by thread: Re: Supressing Plot Output