DataScholars

A blog about data science, computer science, machine learning, artificial intelligence, computational social science, data mining, analysis, and visualization.

Sprak: Graph Visualization From The Command Line

by reiver

So you are at the command line. You have a bunch of data you pulled from the database or a file. You did a bunch of "magic" to awk, sort and other command line tools to extract the "important" parts of the data.

Now you want to see that "important" extract in a graph.

What's the fastest way to visualize it? What's the fastest to see a graph?

MS Excel? OpenOffice Calc? GNU Octave? R?

No, no, no and no.

The fastest way is using spark.

Spark lets you create and view graphs right from the command line.

Here is a very basic example:


spark 0 30 55 80 33 150
				
Figure 1. Very basic usage of spak.

▁▂▃▅▂▇
				
Figure 2. Output of spark command in figure 1.

And here is a more typical example:


curl http://earthquake.usgs.gov/earthquakes/catalogs/eqs1day-M1.txt --silent | sed '1d' | cut -d, -f9 | spark
				
Figure 3. More typical usage of spak. Magnitude of earthquakes over 1.0 in the last 24 hours.

 ▅▆▂▃▂▂▂▅▂▂▅▇▂▂▂▃▆▆▆▅▃▂▂▂▁▂▂▆▁▃▂▂▂▂▃▂▆
				
Figure 4. Output of spark command in figure 3.

(More spark examples here.)

Check out spark.

--
submit to reddit
comments powered by Disqus