Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: Combining two paramteric plots into one.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49119] Re: Combining two paramteric plots into one.
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 2 Jul 2004 02:01:18 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <cc0luf$kp5$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

what may the option DisplayFunction->Identity do ?
Supress the output from a generated graphics ??

ellipsePlot[{xc_, yc_, w_, h_, a_}, n_] :=
    ParametricPlot[
      {ellipsePoint[{xc, yc, w, h, a}, 2\[Pi] t/n][[1]],
       ellipsePoint[{xc, yc, w, h, a}, 2\[Pi] t/n][[2]]},
      {t, 0, n},
       AspectRatio -> Automatic,DisplayFunction->Identity]

ellipsePlotTwo[{xc1_, yc1_, w1_, h1_, a1_},
               {xc2_, yc2_, w2_, h2_, a2_}] :=
    Show[
      ellipsePlot[{xc1, yc1, w1, h1, a1}],
      ellipsePlot[{xc2, yc2, w2, h2,
a2}],DisplayFunction->$DisplayFunction]

Regards
  Jens

Bob Harris wrote:
> 
> Howdy,
> 
> I'm trying to plot two ellipses together on one plot.  I have accomplished
> this, except that mathematica plots three figures-- ellipse 1, then ellipse
> 2, then the combination of the two.  I want to avoid the first two figures.
> 
> Here's what I am doing.
> 
> ellipsePoint[{xc_, yc_, w_, h_, a_}, t_] :=
>     {((w Cos[a] Cos[t] - h Sin[a] Sin[t]) + xc)/2,
>      ((w Sin[a] Cos[t] + h Cos[a] Sin[t]) + yc)/2}
> 
> ellipsePlot[{xc_, yc_, w_, h_, a_}] :=
>     ellipsePlot[{xc, yc, w, h, a}, 20]
> 
> ellipsePlot[{xc_, yc_, w_, h_, a_}, n_] :=
>     ParametricPlot[
>       {ellipsePoint[{xc, yc, w, h, a}, 2\[Pi] t/n][[1]],
>        ellipsePoint[{xc, yc, w, h, a}, 2\[Pi] t/n][[2]]},
>       {t, 0, n},
>       AspectRatio -> Automatic]
> 
> ellipsePlotTwo[{xc1_, yc1_, w1_, h1_, a1_},
>                {xc2_, yc2_, w2_, h2_, a2_}] :=
>     Show[
>       ellipsePlot[{xc1, yc1, w1, h1, a1}],
>       ellipsePlot[{xc2, yc2, w2, h2, a2}]]
> 
> Apparently what happens is ParametricPlot[...] always draws a figure so when
> I call it inside Show (via ellipsePlot[...]), I get a figure drawn that I
> don't want to draw yet.  How can I call ParametricPlot and just get the
> resulting graphical object without it drawing it?
> 
> I have similar problems with other combinations with ellipsePlot.  For
> example, using ListPlot to try to add a list of points on the figure (i.e.
> Show[ellipsePlot[...], ListPlot[...]]) I get three figures instead of just
> the one I want.
> 
> Thanks,
> Bob H


  • Prev by Date: Re: Troubles with Integrating certain functions in 5.0
  • Next by Date: Re: converting table output and plotting
  • Previous by thread: Combining two paramteric plots into one.
  • Next by thread: Re:MATHEMATICA AND FINANCIAL CALCULATIONS?