0
votes

I was hoping you could help me solve this error. I have used the ListPlot function to plot the points from a table containing my data but there's an error saying that the data from that table is not a list of numbers or pairs of numbers. I looked at a similar question (ListPlot: Data is not a list of numbers or pairs of numbers) but I don't know how to cut my data to the previous value since I used the Table function instead of enumerating all my data.

Here is the code that I have:

ListPlot[{Table[{Re\[Sigma][[i, 1]], Re\[Sigma][[i, 2]]}, {i, data}], 
  Table[{Re\[Sigma]2[[i, 1]], Re\[Sigma]2[[i, 2]]}, {i, data}], 
  Table[{Re\[Sigma]3[[i, 1]], Re\[Sigma]3[[i, 2]]}, {i, data}], 
  TheoRe, TheoRe2, TheoRe3}, 
 Joined -> {False, False, False, True, True, True}, 
 PlotRange -> {{0.2, 1}, All}, 
 PlotStyle -> {Red, Green, Blue, Red, Green, Blue}, Frame -> True, 
 FrameLabel -> {"Frequency (THz)", "Re[\[Sigma]](S/cm)"}] 

Here is the error message:

ListPlot:{{{0.195,542.817},{0.2025,537.982},{0.21,532.924},{0.2175,527.697},{0.225,522.354},{0.2325,516.942},<<40>>,{0.54,525.589},{0.5475,533.829},{0.555,542.419},{0.5625,551.344},<<58>>},{<<1>>},<<2>>,{},{}} is not a list of numbers or pairs of numbers.

Thanks in advance!

1

1 Answers

0
votes

Showing the exact contents of that error message was VERY helpful. Thank you for that.

Does

ListPlot[{Table[{Re\[Sigma][[i, 1]], Re\[Sigma][[i, 2]]}, {i, data}]}]

correctly display the first set of points?

Does

ListPlot[{Table[{Re\[Sigma][[i, 1]], Re\[Sigma][[i, 2]]}, {i, data}], 
  Table[{Re\[Sigma]2[[i, 1]], Re\[Sigma]2[[i, 2]]}, {i, data}]}]

correctly display the first two sets of points?

Does

ListPlot[{Table[{Re\[Sigma][[i, 1]], Re\[Sigma][[i, 2]]}, {i, data}], 
  Table[{Re\[Sigma]2[[i, 1]], Re\[Sigma]2[[i, 2]]}, {i, data}], 
  Table[{Re\[Sigma]3[[i, 1]], Re\[Sigma]3[[i, 2]]}, {i, data}]}]

correctly display the first three sets of points?

Does

ListPlot[{Table[{Re\[Sigma][[i, 1]], Re\[Sigma][[i, 2]]}, {i, data}], 
  Table[{Re\[Sigma]2[[i, 1]], Re\[Sigma]2[[i, 2]]}, {i, data}], 
  Table[{Re\[Sigma]3[[i, 1]], Re\[Sigma]3[[i, 2]]}, {i, data}],
  TheoRe}]

correctly display the first four sets of points?

If you then insert TheoRe2 does the error appear? If you then insert TheoRe3 does the error appear?

The error message sort of hints that the last list or the last two or maybe the last three lists of points might be empty and that might be causing the error. Can you check to see that TheoReand TheoRe2 and TheoRe3 are lists of points that can be plotted, even by themselves?