Re: ruby root - Why appears TCanvas?

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 29 Jan 2010 16:12:30 -0600


Hi,

Try gROOT.SetBatch(kTRUE)

Cheers,
Philippe.

On 1/28/10 5:48 PM, Robert Riemann wrote:
> 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|
> element = "reco_" + element
> end
>
>
> 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 - 23:12:34 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 04 2010 - 11:50:01 CET