2
$\begingroup$

I want to have a multiple curves plot which describes the energies of electron respect to distance. After importing data from excel, I have a table as below. The first row is the distances. Each of the next row contains the value at the above distance respectively. Do you have any way to plot them together quickly rather than plot each of them and use the command "Show" to show them all together because actually I have 900 rows to plot in total. Thank you.

TableForm[{{{1., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, 
 -72301.1, -70939.1, -71451.4, -71451.4, -70378.6, -70606.6, -70606.6, -70606.6, -70378.6, 
 -70215.5, -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{1.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{2., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70606.6, -70606.6, -70606.6, -70378.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{2.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{3., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{3.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{4., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{4.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{5., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{5.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{6., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{6.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{7., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{7.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{8., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{8.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{9., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70606.6, -70606.6, -70378.6, -70378.6, -70215.5, -70215.5, 
 -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7, -69875.}, 
{9.5, -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}, 
{10., -139041., -86900.4, -86900.4, -77244.8, -77244.8, -73865.3, -73865.3, -72301.1, -72301.1, 
 -70939.1, -71451.4, -71451.4, -70378.6, -70378.6, -70606.6, -70606.6, -70606.6, -70215.5, 
 -70215.5, -70094.8, -70094.8, -70003.1, -70003.1, -69931.7, -69931.7}}}]
$\endgroup$
3
$\begingroup$

I removed the TableForm and the highest level {}, then set it equal to data. If I understand your question correctly, TemporalData does what you want (but for distance not time in this case).

data = Import["Book2.csv"];    
{row, col} = Dimensions[data];
x = data[[All, 1]];
y = Transpose@Table[data[[i, 2 ;; col]], {i, 1, row}];
tempData = TemporalData[y, {x}];
ListLinePlot[tempData, PlotRange -> All]

enter image description here

Specific range:

data = Import["Book2.csv"];

{row, col} = Dimensions[data];
minRange = 700;
maxRange = 750;

x = data[[All, 1]];
y = Transpose@Table[data[[i, minRange ;; maxRange]], {i, 1, row}];
tempData = TemporalData[y, {x}];
ListLinePlot[tempData, PlotRange -> All]

enter image description here

$\endgroup$
  • $\begingroup$ @QuangPhan et al. How to get separate plots rather then on one graph in above case? I have similar problem. Thank you. $\endgroup$ – Aman Apr 7 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.