# Creating a list of ListPolarPlot snapshots to animate

I'm trying to create a list of "snapshots" of the function ListPolarPlot to create a exportable gif or animation. My attempt is somewhat taken from this answer. The idea is to create this list of "snapshots" and then use the function ListAnimation to create the movie.

However, it gives the below error. My goal is to create a exportable gif or animation of this plot

The inputs theta and polarray are lists of angular and radial coordinates in polar coords, respectfully. They represent a numerical approximation of time-dependent planetary motion.

All suggestions would be greatly appreciated! Thank you in advance for any help!

• Where are θ and polarray? – J. M. will be back soon Sep 10 '17 at 4:13
• They're the inputs for making the plot. They're just simple lists of doubles. EDIT: I suspect my issue is almost certainly that I poorly understand how to implement pure functions using #, &, @ etc. – JeremyPenn Sep 10 '17 at 4:14
• try replacing & /@ {theta, polarray} with & @@@ {theta, polarray} – Jason B. Sep 10 '17 at 4:34
• It θ and polararray are lists, you could replace {#1, #2} with {#[[1]], #[[2]]}, and {θ, polararray} with Transpose[{θ, polararray}]. – aardvark2012 Sep 10 '17 at 4:38

Since the OP was unable/unwilling to produce the θ and polarray lists, I'm making my own:

orbit[θ_] = With[{a = QuantityMagnitude[PlanetData["Earth", "SemimajorAxis"]],
b = QuantityMagnitude[PlanetData["Earth", "SemiminorAxis"]]},
b^2/(a + Sqrt[a^2 - b^2] Cos[θ])]

θList = N[Range[0, π/2, π/32]];
rList = orbit[θList];


From there:

data = Transpose[{θList, rList}];
frames = Table[ListPolarPlot[Take[data, k], Axes -> None, Frame -> True,
PlotMarkers -> Style["×", Large],
PlotRange -> {{0, 1}, {0, 1}}, PlotStyle -> ColorData[97, 2]],
{k, Length[data]}];
ListAnimate[frames]


• Thank you! This is exactly what I needed! – JeremyPenn Sep 10 '17 at 16:26