Re: ParametricPlot
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: ParametricPlot
- From: twj
- Date: Fri, 19 Feb 93 08:41:20 CST
>I have a function of one argument that returns a point in a plane, >that is a list {a,b}. I would like to get a plot of this function >and I have used ParametricPlot >but this is what I get: > >In[34]:= ParametricPlot[Td,{theta,-Pi,Pi}] > >ParametricPlot::ppcom: > Function Td cannot be compiled; plotting will proceed with the >uncompiled > function. > >ParametricPlot::pptr: > Td does not evaluate to a pair of real numbers at theta = -3.14159. There are two problems here as shown by the two error messages. The second message arrives because ParametricPlot has set theta to a value and then evaluated the first argument Td. It is expecting the first argument to evaluate to a pair of real numbers and since it has not an error results. I presume the problem here is that Td is set up to be a function of one argument and hence the error results. To make it work we must supply the argument... In[4]:= Td[ t_] := {Sin[t], Cos[t]} In[5]:= ParametricPlot[ Td[ t], {t,0,Pi}] ParametricPlot::ppcom: Function Td[t] cannot be compiled; plotting will proceed with the uncompiled function. Out[5]= -Graphics- ParametricPlot cannot do this automatically since it is possible that instead Td may have been set to return an expression... In[8]:= Td := {Sin[2 t], Cos[t]} In[9]:= ParametricPlot[ Td, {t,0,Pi}] ParametricPlot::ppcom: Function Td cannot be compiled; plotting will proceed with the uncompiled function. Out[9]= -Graphics- The other problem which is demonstrated by the ParametricPlot::ppcom message is from the Mathematica compiler. At the moment this can only return numbers. The example here is trying to return a list of numbers which cannot be done and the compiler cannot be used. ParametricPlot then continues with the uncompiled function and the result is EXACTLY the same as if the command In[10]:= ParametricPlot[ Td, {t,0,Pi}, Compiled -> False] Out[10]= -Graphics- was entered which does not use the internal compiler. Tom Wickham-Jones WRI