Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to show how a vector M varies over time. I have the following code:





(In actuality, my lists Mx, My, and Mz are much longer, but the shorter lists above reproduce the error behavior.)

I get the following error:

An improperly formatted option was encountered while reading a Graphics3DBox. The option was not in the form of a rule.

Do you know how I can fix this? I do not understand which option "was not in the form of a rule."

share|improve this question
up vote 8 down vote accepted

You have a stray argument in the Graphics3D function (Axes).
Also, you probably want a fixed PlotRange. Try:

    Arrow[Tube[{{0, 0, 0}, {Mx[[i]], My[[i]], Mz[[i]]}}]]}, 
    Axes -> True, AxesLabel -> {"x", "y", "z"}, 
    PlotRange -> ({Min@# - 5, Max@# + 5} & /@ {Mx, My, Mz})],
 {i, 1, Length[Mx], 1}

Mathematica graphics

In the future try to debug your own code. You would have seen the same problem without the Animate function if you tried that. Also, the error code suggests that something is wrong with the graphics options, which should have directed your attention to the arguments of Graphics3D.

share|improve this answer
Thanks. I have voted to close my question as being too localized. (I missed my silly mistake.) – Andrew May 26 '12 at 22:41
Or maybe I should delete the question? What do you think? – Andrew May 26 '12 at 22:52
@Andrew I'd rather have the points but I'm OK with it. :-) – Mr.Wizard May 26 '12 at 23:33
I think the fixed plot range is a reasonable question. The stray Axes that was causing the error can just be edited out of the question. – Brett Champion May 27 '12 at 1:55
@Andrew see Brett's comment above. – Mr.Wizard May 27 '12 at 2:05

You may also play some tricks:

h = Transpose[Table[{Cos@t, Sin@t, t^.1}, {t, 0, 8 Pi, .1}]];
d = Interpolation[#, InterpolationOrder -> 1] & /@ h;

  Graphics3D[{Blue, Arrow[Tube[{{0, 0, 0}, Through@d@t}]]}, Axes -> True, 
              AxesLabel -> {x,y,z}, PlotRange -> ({1.1 Min@#, 1.1 Max@#} & /@ h)],

  ParametricPlot3D[Through@d@v, {v, 1, t}, ColorFunction -> Function[{x, y, z, u}, Hue[z]]]],
 {t, 1.001, Length@First@h}

Full Movie Link

enter image description here


Fancier, by using InterpolatingFunctio[] properties:

<< DifferentialEquations`InterpolatingFunctionAnatomy`

pltIntFun[d:{_InterpolatingFunction ..}]:=Module[{pRange,manipDomain,k = (Max@# - Min@#) 10^-4 &},

   pRange      = { Min@# - k@#, Max@# + k@#} & /@ Through@d@"ValuesOnGrid";
   manipDomain = Join[{t}, ({ Min@# + k@#, Max@#} & /@ Through@d@"Domain")[[1]]];

      {Blue, Arrow[Tube[{{0, 0, 0}, Through@d@t}]]}, 
       Axes -> True, AxesLabel -> {x, y, z}, PlotRange -> pRange],

     ParametricPlot3D[Through@d@v, {v, 1, t}, ColorFunction -> Function[{x, y, z, u}, Hue[z]]]],

d = Interpolation[#,InterpolationOrder->1] &/@ Transpose[Table[{Cos@t,Sin@t,t^.1}, {t,0,8 Pi,.1}]];
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.