2
$\begingroup$

Can anyone help me to show many lists on one plot. I have the following data;

Outputakhir = 
  TableForm[Transpose[{tlist, k1list, k2list, eb1list, eb2list, n1list, n2list}]]    
TableForm[
    {{masa, kest1, kest2, entrop1, entrop2, negat1, negat2}, 
     {0, 1, 1, -13.999999999999998, -13.999999999999998, 0, 0}, 
     {12.004999999999981, 1., 0.9999691595472917, -13.999961890377083, 
      -13.99986434867277, -0.00001542093979234327, -0.000023131052976799182}, 
     {24.05699999999996, 1., 0.9960264734652062, -13.994434468268233, 
      -13.981842876500487, -0.001998796793604707, -0.002992194397865189}, 
     {36.12499999999994, 1., 0.9815234829836469, -13.961735659671618, 
      -13.90272335915691, -0.009515058436080692, -0.014135909155472803}, 
     {48.223999999999926, 1., 0.9462186035211008, -13.768212830773868, 
      -13.5919332913098, -0.029694686123548975, -0.04319194284310213}}]

I want to plot {k1list, k2list, eb1list, eb2list, n1list, n2list}} as a function of masa, all in a single cell, but withe each list drawn with a different pattern of line.

$\endgroup$

2 Answers 2

3
$\begingroup$
raw = {{masa, kest1, kest2, entrop1, entrop2, negat1, negat2}, {0, 1, 
    1, -13.999999999999998, -13.999999999999998, 0, 
    0}, {12.004999999999981, 1., 
    0.9999691595472917, -13.999961890377083, -13.99986434867277,
    -0.00001542093979234327, -0.000023131052976799182},
    {24.05699999999996, 1., 
    0.9960264734652062, -13.994434468268233, -13.981842876500487,
    -0.001998796793604707, -0.002992194397865189}, {36.12499999999994, 1.,
    0.9815234829836469, -13.961735659671618, -13.90272335915691,
    -0.009515058436080692, -0.014135909155472803}, {48.223999999999926, 
    1., 0.9462186035211008, -13.768212830773868, -13.5919332913098,
    -0.029694686123548975, -0.04319194284310213}};

data = raw[[2 ;; 6]];
{row, col} = Dimensions[data];
x = data[[All, 1]];
y = Transpose@Table[data[[i, 2 ;; col]], {i, 1, row}];
tempData = TemporalData[y, {x}];
ListLinePlot[tempData, PlotLegends -> raw[[1]], PlotRange -> All]

enter image description here

$\endgroup$
6
  • $\begingroup$ thank you very much. I try it first $\endgroup$
    – munirah
    Commented Aug 1, 2016 at 5:02
  • $\begingroup$ I already try it but not get the result. Can @Young explain me what the meaning each of the coding you write. tq $\endgroup$
    – munirah
    Commented Aug 1, 2016 at 5:34
  • 1
    $\begingroup$ @munirah Did you see how I removed the TableForm command? $\endgroup$
    – Young
    Commented Aug 1, 2016 at 5:36
  • $\begingroup$ Yes, i know about that. what it mean by 1.raw[[2 ;; 6]], $\endgroup$
    – munirah
    Commented Aug 1, 2016 at 5:39
  • 1
    $\begingroup$ @munirah I'm taking the part of the table with the data, removing the heading ... if you are using this on a table with more rows you will need to increase the number 6 $\endgroup$
    – Young
    Commented Aug 1, 2016 at 5:41
4
$\begingroup$

Description

Here is an alternative solution. Note, raw is your original data.

Example

ListLinePlot @ (Transpose[{raw[[2 ;; All, 1]], #}] & @ # & /@ Table[raw[[2 ;; All, i]], {i, 2, Length @ raw}])

Output

enter image description here

$\endgroup$
1
  • $\begingroup$ Tqvm. Iwill try it $\endgroup$
    – munirah
    Commented Aug 1, 2016 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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