# Making an animation of the progressive plotting of imported data

I have managed to import data from an Excel XLSX file using Import.

dat = Import[
"C:\\Users\\User\\Documents\\Conductance\\mathfile.xlsx", {"Data"}];


There are two columns of data from which I would like to produce a ListAnimate / Animate plot.

I tried something like this:

points = Table[ListPlot[dat[[1, b]], PlotRange -> All], {b, 1, 10}];
ListAnimate[points]


This produces an animation but no points are plotted. The first point appears correctly, the rest seem to plot only a point corresponding to the first col.

The original data is in the form of a normal number (col 1) and a number using scientific notation, e.g., 4e-5 (col 2). Do I have to format my data in a different format?

• Mathematica does not recognize numbers formatted like 4e-5. However, I think the import expression converts such numbers to Mathematica reals. Can't be sure because I don't have access to Excel or any .xlsx files. – m_goldberg Jul 28 '17 at 14:39
• @m_goldberg You can use InternalStringToDouble, that recognizes that notation, and the importer uses that. – FJRA Jan 24 '18 at 20:17

For speed reasons, I would avoid ListPlot and just use Graphics directly. Here is some sample data:

data = Table[{x,Sin[x]},{x,0,10,.01}];


And, here is an animation:

Animate[
Graphics[
{Line[data[[;;i]]]},
PlotRange->{{0,10},{-1,1}}
],
{i, 1, Length[data], 1}
]


dat = Import["C:\\Users\\User\\Documents\\Conductance\\mathfile.xlsx"{"Data"}];
points = Table[dat[[1, j]], {j, 1, 10}];

tag = Table[ Take[points, n], {n, 1, 8, 1}];
Manipulate [ListPlot[tag[[c]]], {c, 1, 8, 1}]

• points = data[[All, 2]]` is really much better way to extract column 2. – m_goldberg Jul 28 '17 at 14:57