Trying putting this before any canvases are created:
ROOT.gROOT.SetBatch(ROOT.kTRUE)
Also if you are using TTree::Draw, the “goff” option is quite useful for creating histograms in memory without drawing them graphically.
If you end up switching between Batch and Non-Batch mode in the same script, you might want to read this:
[url]SetBatch(ROOT.kFALSE)?
Jean-François