Hi rooters,
I want to plot my histograms using the ruby module from root. The result is fine, but I wonder why the canvas are shown to me one after each other up the end of program.
Is it possible to disable graphics in the ruby module?
Regards,
Robert
Script with highlighting: http://pastie.org/799713 Script:
#!/usr/bin/ruby
require 'libRuby'
hist_names = %w{ DiJet_R_diff DiJet_R_diff_after_boost DiJet_angle_after_boost DiJet_phi_diff Jet_acoplanarity Jet_aplanarity Jet_centrality Jet_sphericity Jet_thrust }hist_names.map! do |element|
dataFileName = ARGV[0]
dataOutputFileNameSuffix = "_hist.png"
dataOutputFolder = "plots/" # have to be created manually
size = [800, 600]
options = ""
file = TFile.new dataFileName
hist_names.each do |hist_name|
histogram = file.Get( hist_name )
canvas = TCanvas.new("canvas_" + hist_name , hist_name, size[0], size[1])
histogram.Draw( options )
canvas.SaveAs( dataOutputFolder + hist_name + dataOutputFileNameSuffix )
end
Received on Fri Jan 29 2010 - 00:48:51 CET
This archive was generated by hypermail 2.2.0 : Fri Jan 29 2010 - 23:50:01 CET