MathGroup Archive 1998

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

Search the Archive

Re: ParametricPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14555] Re: ParametricPlot
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Fri, 30 Oct 1998 03:07:27 -0500
  • References: <70rkm0$4u5$8@dragonfly.wolfram.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Peter wrote in message <70rkm0$4u5$8 at dragonfly.wolfram.com>...
>I have the following defintion in Mathematica notebook (version 3.01 for
>Mac):
>
>eight[t_]:={Sin[t],Sin[t] Cos[t]}
>
>Trying to plot this by executing
>
>ParametricPlot[eight[t],{t,0,2 Pi}];
>
>produces the right graphic but also an warning:
>
>ParametricPlot::"ppcom": "Function eight[t] cannot be compiled; plotting
>will proceed with the uncompiled function."
>
>What is wrong ?
>
>Email: phuesser at bluewin.ch
>



Peter:
Nothing wrong: with ParametricPlot[eight[t],{t,0,2 Pi}] Mathematica
looks at eight[t] before it is evaluated to ={Sin[t],Sin[t] Cos[t]} and
decides that it cannot compile the function eight:

ParametricPlot[eight[t],{t,0,2 Pi}];//Timing

ParametricPlot::"ppcom":
    "Function eight[t] cannot be compiled; plotting will proceed with \
the uncompiled function."

{1.15 Second,Null}

But we can make it look at the evaluated function (which it sees that it
can compile):


ParametricPlot[Evaluate[eight[t]],{t,0,2 Pi}];//Timing

{0.28 Second,Null}

As expected this is a lot quicker.

In fact this is equivalent to

ParametricPlot[{Sin[t],Sin[t] Cos[t]},{t,0,2 Pi}];//Timing

{0.28 Second,Null}

Allan

----------------------
Allan Hayes
Mathematica Training and Consulting
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: Re: 2 ticks on a 2D plot
  • Next by Date: Re: Problem plotting a piecewise function
  • Previous by thread: Re: ParametricPlot
  • Next by thread: page breaks