I've got a data file that looks something like the following:
2016-08-16 dogs 12
2016-08-16 cats 9
2016-08-17 cats 4
2016-08-17 mice 42
2016-08-17 dogs 6
That is: date series count
.
Note that the series are not in a consistent order on each day (and might not appear at all).
Further, my input file doesn't have the dates in order either (though I can fix that with sort
if I have to), and some of the dates might be missing (because there are no data points for that day).
I'd like to use gnuplot to render this. The X-axis should display the date; the Y-axis should display the count; each series should be its own line, with labels in the legend.
I know how to render each series from a separate file, but the series are not fixed, so I'm looking for something that doesn't require that.
How do I do this?
Note: I'm using gnuplot 4.4
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…