Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (43 sloc) 1.51 KB


A collection of erubis templates for plotting with R and ruby.


You’ll need to install R:

# ubuntu
sudo apt-get install R

For mac os x try: If the mac installer doesn’t already, symlink the Rscript executable to /usr/bin/Rscript.

Once R is installed, install ggplot2.

Rprompt$: install.packages("ggplot2")


Provided are some examples of using the templates with Swineherd. All examples make use of the configliere gem, thus using --help as an option should print options specific to that plot example.

XY plot

./xyplot.rb --points --width=800 --title="Henon Map" --point_size=0.01 data/henon.tsv


./histogram.rb data/frequency.tsv

Log-Log Histogram

./logloghist.rb data/frequency.tsv

World Map

./worldmap.rb --lat=2 --lon=3 data/airports.tsv

Timeseries with Months

Often it is the case you’ve got timeseries of the form:

 201006 1234
 201007 5678

This transforms the month field into something R can understand and plots it with the right scaling.

./monthseries.rb --month=2 --y=3 --xlab="Month" --ylab="Passengers in + Passengers out" data/passengers_in_out_lax_airpt.tsv

More are on the way.