Monday 18 November 2019

command line - Ascii-art graphs in Linux


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.



Answer



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"

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...