Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: How to suppress plot output ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58459] Re: [mg58451] How to suppress plot output ?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sun, 3 Jul 2005 03:57:12 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Paul,

First method: Use the DisplayFunction -> Identity option to suppress output
and use DisplayFunction -> $DisplayFunction to turn it back on.

plot1 = Plot[Sin[x], {x, 0, 2Pi}, DisplayFunction -> Identity];
plot2 = Plot[Cos[x], {x, 0, 2Pi}, DisplayFunction -> Identity];
Show[plot1, plot2, DisplayFunction -> $DisplayFunction];

Second method: Use the Block construct to temporarily reset
$DisplayFunction.

Block[{$DisplayFunction = Identity},
  plot1 = Plot[Sin[x], {x, 0, 2Pi}];
  plot2 = Plot[Cos[x], {x, 0, 2Pi}];]
Show[plot1, plot2];

Third method: Use the DisplayTogether command.

Needs["Graphics`Graphics`"]

DisplayTogether[
    Plot[Sin[x], {x, 0, 2Pi}],
    Plot[Cos[x], {x, 0, 2Pi}]];

However, these constructs can get a little confusing if you want to add
other elements to your plots, such as Lines, Points or Text statements to
label the curves. In that case you may want to use the fourth method, which
uses the DrawGraphics package at my web site.

Needs["DrawGraphics`DrawingMaster`"]

Draw2D[
    {Draw[Sin[x], {x, 0, 2Pi}],
     Draw[Cos[x], {x, 0, 2Pi}],
     Text["Sin", {Pi/2, Sin[Pi/2]}, {-2.5, 0}],
     Text["Cos", {1.2, Cos[1.2]}, {-1.5, 0}]},
    Axes -> True,
    PlotRange -> All];

Also, for any of the methods, if you want to use the plot in a document you
can close the input cell that contains all the graphics code. Select the
Input cell bracket on the right hand side and use Alt CRC. Or use
Menu/Cell/Cell Properties/Cell Open. That will close the cell so only a thin
blank space, with the right hand bracket remains. You can still select and
evaluate the cell so your readers can see the graphics but not the code. If
you pass the notebook to someone else you will probably have to remind them
to evaluate the cells because many people are not aware of this feature and
overlook the thin cells. (This is not the same as Open/Close Group.)

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/







From: Paul McHale [mailto:paul.mchale at _NO_$PAMearthlink.net]
To: mathgroup at smc.vnet.net


Hi,

I am having difficulty forcing a suppression of output for mathematica
commands when writing documents.  I want to show a multi-part graph:

plot1=Plot[ ... ];
plot2=Plot[ ... ];
plot3=Plot[ ... ];
plot4=Plot[ ... ];

Show[ plot1, plot2, plot3, plot4 ];

In the above, I get four individual plots and one final plot.  How do
I suppress the first four?

Thanks,
Paul



  • Prev by Date: Re: Integrate and Boole problems
  • Next by Date: Re: how to find n in expression x^n using a pattern?
  • Previous by thread: Re: How to suppress plot output ?
  • Next by thread: Re: Re: How to suppress plot output ?