# plotting evolution of points in the same plot

I am trying to plot the points (i,j,k) as they are generated in the loop but in the same plot. The next draws the points in different windows.

list = {};
Do[list = Append[list, {i, j, k}];
Print[ListPointPlot3D[list]], {i, 3}, {j, 3}, {k, 3}]


Is there any function in Mathematica that allows us to draw plots dynamically, i.e., keeping the plots that were already generated as new ones are being generated from a loop (all in the same window)?

-
Why not just generate the points all at once, use Take[] on the list of points, and then plot that particular subset? – J. M. Nov 18 '12 at 6:08

There are many ways to do this. Here is one way which keeps your procedural code setup of using a loop. Make a plot variable p as Dynamic. So the frontend will update p automatically each time it is changed inside the loop.

list = {};
p = {};
Dynamic[p]

Do[
list = Append[list, {i, j, k}];
p = ListPointPlot3D[list],
{i, 10}, {j, 10}, {k, 5}
]


-

Here is a different approach using ListAnimate and Part to create a point by point animation of an arbitrary set of points, and which can be viewed at various frame rates and keeps a constant range of plot as more points are added.

Define some points and extract the range of the points:

points = Tuples[Range@4, 3];
range = {1, Max@#} & /@ Transpose@points;


Animate the plotting of the points:

ListAnimate[ListPointPlot3D[points[[1;;#]], PlotRange->range]& /@ Range@Length@points]


-