3

I have a text file that represents the runtime of a specific script, with each line representing one run:

141
124
156
204
498
512
444
374
189
120
143
132

One can see that the section that I pointed out represents a spike in the script runtime. Is there any package which will make an ascii-art graph out of this data, which could be viewed with cat or vim? I could write a script which, when given a terminal width, split the file into lineCount / terminalWidth chunks, average them, and then by column make a graph of the data. However, if there already exists such a package then I'd love to know about it.

Thanks.

4
  • 1
    Same as this question
    – Praveen
    Oct 18, 2012 at 16:04
  • Can't you cook up a simple script to output something like this?
    – Karan
    Oct 18, 2012 at 16:08
  • @Praveen: thank you, I had no idea that gnuplot could output ascii graphs. Nice!
    – dotancohen
    Oct 18, 2012 at 16:57
  • @Karan: Doing the bars vertically is trivial, I would prefer something vertical. I could write it myself, but if the software already exists (apparently it does: gnuplot) then I don't want to reinvent the wheel.
    – dotancohen
    Oct 18, 2012 at 16:58

1 Answer 1

3

Stackoverflow has a very similar question. As I cannot mark this Superuser question as a dupe of the Stackoverflow question, I'll summarise here: The application that can make an ascii-art graph out of the data is gnuplot.

gnuplot> set terminal dumb
gnuplot> plot "runtime.txt"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .