# Why is ListLinePlot outputting weird graph

s = Import["Directory/FileName.xlsx"]
ListLinePlot[s[[1]], AxesLabel -> {"Time", "Voltage"}]


The graph is some sine wave but it outputs a huge number of lines going out from x=1 instead. My FFT gives a sensible output so this probably isn't a data import issue.

I've tried this on two different computers and I get identical outputs. I would like to know how to resolve this issue and out of curiosity, why it is happening

• What if you use s[[1, All, ;; 2]]? I ask because s is n x m x 3 instead of n x m x 2. – Kuba May 1 '18 at 8:34
• What does ListPlot give? It might be that the points are not in proper order, so ListLinePlot tries to connect the wrong points. Could you also check if ListLinePlot works for the first few points? – Himalaya Senapati May 1 '18 at 10:07

As Kuba mentioned it seems like you have n x m x 3 instead of n x m x 2. To simulate this

ListLinePlot[{Table[{t, Cos[π t/0.0001],}, {t, 0, .001,
0.00001}]}[[1]]


note the extra comma included after the cosine. This gives you something similar to yours:

without the extra comma:

ListLinePlot[{Table[{t, Cos[\[Pi] t/0.0001]}, {t, 0, .001,
0.00001}]}[[1]]]


to achieve this you can as suggested run:

ListLinePlot[s[[1, All, ;; 2]]]

• Thanks, this resolves the problem. Looks like my data format is erroneous – Dayrius Tay May 1 '18 at 12:57