2
$\begingroup$

A have set of parameters (p1, p2, p3, l, ...) taken at different time. I would like to plot them connecting the same param. with arrows from older point to the recent ones so I could see evolution of params in time. Could you help please. No idea how to do it :(

mydata = {
 {"p1", "2015-11-26", 5, 6},
 {"p3", "2015-05-30", 15, 5},
 {"p1", "2014-01-17", 9, 16},
 {"p2", "2015-11-26", 5, 6},
 {"p2", "2013-06-03", 0, 1},
 {"l4", "2015-01-07", 17, 5},
 {"p3", "2015-01-07", 9, 12},
 {"p3", "2015-03-07", 24, 13},
 {"p3", "2015-06-07", 19, 16}

 }

ListPlot[Partition[mydata[[All, 3 ;; 4]], Length[mydata]][[1]], 
PlotRange -> All]
$\endgroup$
0

1 Answer 1

2
$\begingroup$
ListLinePlot[(SortBy[#, #[[2]] &] & /@ GatherBy[mydata, First])[[All, All, 3 ;; 4]], 
 PlotLegends -> DeleteDuplicates[mydata[[All, 1]]],BaseStyle -> Thick] /. 
  Line -> Arrow

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ How can I style arrows in this solution? $\endgroup$ Jun 8, 2016 at 22:17
  • 2
    $\begingroup$ @ФилиппЦветков, you can use Arrowheads with PlotStyle; for example, PlotStyle -> Directive[Thick, Arrowheads[.075]]. $\endgroup$
    – kglr
    Jun 8, 2016 at 22:23

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.