Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am using the following code to animate a 20 3D ListPointPlots:

Dat2={{0.`, 0.`, 0.`}, {0.`, 0.`, 0.`}, {0.`, 5.`*^-8, 1.`*^-7}, {0.`, 
   5.`*^-8, 1.`*^-7}}[{{0.309017`, 0.077252`, 0.`, 0.`, 0.`, 0.`, 0.`,
    0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0, 
   0}, {0.00041012`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`,
    0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0}}, {{0.587785`, 
   0.262821`, 0.0193124`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`,
    0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0, 0}, {0.00108769`, 
   0.000102527`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 
   0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0}}];

Animate[ListPointPlot3D[{Transpose[{Dat2[[n]][[3]], 
        Dat2[[n]][[1]]}] /. {x_?NumericQ, y_?NumericQ} :> {x, y, 0}, 
        Transpose[{Dat2[[n]][[4]], Dat2[[n]][[2]]}] /. {x_?NumericQ, 
        y_?NumericQ} :> {x, 0, y}}, AxesOrigin -> {0, 0, 0}]
        /. Point -> Line, {n, 0, 19, 1}, AnimationRunning -> False]

However, each ListPointPlot3D has a different x range and y range, such that the axes constantly move in the animated picture, making for a poor comparison of the behaviour. Is there any way to fix the axes in the Animate function?

share|improve this question
    
Can you please provide examples from Dat2 so that we can reproduce your problem? –  Sosi Apr 17 '13 at 17:09
    
@Sosi, it's pretty big so have uploaded some example data here: pastebin.com/baRTknJM –  dplanet Apr 17 '13 at 17:13
    
You only need to give a small working example. I am going to edit your post to have a smaller version of your list. Please check if it is still representative –  Sosi Apr 17 '13 at 17:31
1  
Note that Mathematica starts list indices with 1 and not 0. Dat2[[0]] returns the Head of Dat2 instead of its first element. –  István Zachar Apr 17 '13 at 17:35
1  
Ok, that is some strange data structure... Did you intend to use lists as the head of your lists? –  István Zachar Apr 17 '13 at 17:40
add comment

1 Answer 1

up vote 2 down vote accepted

Indeed there is. Just specify the PlotRange.

As an example:

Animate[ListPointPlot3D[{Transpose[{Dat2[[n]][[3]], 
       Dat2[[n]][[1]]}] /. {x_?NumericQ, y_?NumericQ} :> {x, y, 0}, 
    Transpose[{Dat2[[n]][[4]], Dat2[[n]][[2]]}] /. {x_?NumericQ, 
       y_?NumericQ} :> {x, 0, y}}, AxesOrigin -> {0, 0, 0}, 
   PlotRange -> {{0, 10^-6}, {-1, 1}, {-5 10^-6, 5 10^-6}}] /. 
  Point -> Line, {n, 0, 19, 1}, AnimationRunning -> False]
share|improve this answer
add comment

Your Answer

 
discard

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.