Re: Plot without Show
- To: mathgroup at smc.vnet.net
- Subject: [mg79187] Re: Plot without Show
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Fri, 20 Jul 2007 03:34:07 -0400 (EDT)
On 7/19/07 at 3:25 AM, kitschen at romandie.com (kitsche) wrote:
>Hello, I often plot several functions with Plot or its siblings and
>at the end want to show a combined graph with all plots on it.
>p1 = Plot[Sin[x],{x,0,Pi}];
>p2 = Plot[Cos[x],{x,0,Pi}];
>Show[p1,p2];
>The output from the above are 3 plots, p1, p2 and the combined. How
>can I plot p1 and p2 silently, ie. without that their plot shows and
>only show the combined form?
Using Mathematica 6 this would be done as simply:
Show[Plot[Sin[x], {x, 0, Pi}], Plot[Cos[x], {x, 0, Pi}]]
Using earlier versions of Mathematica this works:
Show[
Block[{$DisplayFunction=Identity},
{Plot[Sin[x],{x, 0, Pi}],
Plot[Cos[x],{x, 0, Pi}]}]];
Also keep in mind if you want to plot several functions over the
same range
Plot[{Sin[x],Cos[x]},{x, 0, Pi}]
works in version 6 as well as earlier versions. Version 6 has
the nice feature that this syntax automatically assigns
different colors to each curve in the list.
--
To reply via email subtract one hundred and four