Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 29 lines (24 sloc) 1.08 KB
#!/usr/bin/env ruby
require 'swineherd'
require 'swineherd/script/r_script' ; include Swineherd::Script
Settings.define :width, :default => 1200, :description => "Plot width in pixels"
Settings.define :x, :default => 1, :description => "Column to compute histogram of"
Settings.define :weight, :description => "Column to use as histogram weight"
Settings.define :xlab, :default => "X", :description => "X label"
Settings.define :ylab, :default => "log10(Count)", :description => "Y label"
Settings.define :title, :default => "", :description => "Title of the plot"
Settings.resolve!
raise "No input data!" unless Settings.rest.first
plotter = RScript.new('templates/logloghist.R.erb')
plotter.output << File.basename(Settings.rest.first).gsub(File.extname(Settings.rest.first), ".png")
plotter.attributes = {
:data => Settings.rest.first,
:plot => plotter.output,
:x => Settings.x,
:weight => Settings.weight,
:xlab => Settings.xlab,
:ylab => Settings.ylab,
:title => Settings.title,
:width => Settings.width
}
plotter.run true
Something went wrong with that request. Please try again.