Draw() a hist, Save it - without canvas window?

I’d like to Draw() a histogram without opening a canvas window. I would like to just save it to a file. Is this possible? I’ve trawled the docs and forums for a while now and I can’t figure it out.

Regards.

  • Pete

Hi Pete,

In case you do not want graphics use the batch mode (-b option) when running ROOT:root -b yourMacro.CYour macro will run like before but you will not get anything on the screen. See page 10 of the User’s Guide at ftp://root.cern.ch/root/doc/2GettingStarted.pdf

Cheers, Ilka

Hmm, thanks, I was not aware of that.

What’s the best way to apply this to a standalone application?

Modify what I pass to TApplication to include ‘-b’ ?

Is it possible to turn batch mode on and off?

  • Pete

Hi Pete,

You can usegROOT->SetBatch(kTRUE); //or kFALSEto toggle this mode according your needs.

Cheers, Ilka

When you run your application, you can pass the “-b” option, eg
myapp.exe -b

Rene