0
votes

I'm new to Mathematica, trying to ListPlot set of data having time in the first column and values in the columns 2 and 3.

t = Import["/.../time_deltas.csv", "CSV"]

{{11.1694,0.,0},       {11.1697,0.000275,0}, {11.1702,0.000495,0}, 
 {11.1702,0.000028,0}, {11.1702,1.*10^-6,0}, {11.1702,0.000033,0},
 {11.1707,0.000502,0}, {11.171,0.000314,0},  {11.171,4.*10^-6,0}, 
 {11.1711,0.000025,0}, {25.8519,0.000029,1}, {25.852,0.000049,1},
 {25.852,0.000032,1},  {25.8521,0.000031,1}, {25.8524,0.000388,1},
 {25.8524,1.*10^-6,1}, {25.8525,0.000051,1}, {25.8543,0.001852,1},
 {25.9342,0.079813,0},{25.9391,0.004914,0}}

Plotting a single point I expected that:

ListPlot[{t[[1,2,1]],t[[1,2,2]]}] 

Would plot a single point with x=11.169662 and y=0.000275. Instead it plots two points with x=1,2 and y=11.169662, 0.000275.

What am I doing wrong ?

1
I don't see two points with what you showed. But I also get errors when having three subscripts. This seems to work for me ListPlot[{t[[2,1]],t[[2,2]]}].Bill
@perror Thanks. And sorry i didn't respond earlier - didn't realize need to refresh the page. It should be 2 subscripts. Dimensions[t] produces {66342, 3}iez

1 Answers

0
votes

You need to group the data into x-y pairs for each list plot, e.g.

u = {{#1, #2}, {#1, #3}} & @@@ t;
v = Transpose[u];
GraphicsColumn[{ListPlot[v[[1]]], ListPlot[v[[2]]]}]

v[[1]] shows the data pairs you expect:

{{11.1694, 0.}, {11.1697, 0.000275}, {11.1702, 0.000495}, ... }