svg-plot-gen creates the axes and gridlines for a graph in SVG. Perfect for creating a static background to which live data can be added.
When not to use this
You just want to plot a graph. If you're using Python, check out Pygal, otherwise take a look at gnuplot.
When to use this
When you've got the same format of graph that you just want to plot over and over again, and you haven't got an enviroment that supports plotting graphs some other way. Maybe you're working on an embedded system, have a bash script that for some reason can't use gnuplot or you're trying to make a CouchDB list function output an SVG graph.
Another rationale for using this is that you don't want to waste processing power generating axes and gridlines every time you want to output a graph.
Installation
svg-plot-gen is written in ruby and uses nokogiri to output SVG.
You'll need to install ruby and ruby gems if you haven't already got them installed. Then it should just be a case of running
gem install svg_plot_gen
What it does
It outputs an SVG file that looks somewhat like this to stdout.
That's all.
Usage
Run
svg_plot_gen --help
to see details of all the command line options.
Templates
Specifing the -t
option means the output will contain two [SPLIT]
tags that can be replaced with data by a stream editor like sed
or whatever string manipulation functions exist
in your language.
The first [SPLIT]
tag is for a line graph. If a path is substituted in using the format specified here then this will be
overlayed on the graph. The path is transformed to be relative to the origin of the axes and so that up is positive.
The second [SPLIT]
tag is in the display attribute of a 'No Data Found' marker, and can be substituted for inline
to display this marker.
License
MIT