How to generate outputs (PDF, PNG, etc.) without display?

I want to generate a bunch of outputs (PDF, PNG or othe formats) without display them. How to do? I checked the HOWTOs but have no idea about it.
I hope an example can be added into the HOWTOs.

gROOT->SetBatch(kTRUE); // without graphics gROOT->SetBatch(kFALSE); // with graphics
Jan

Hi,

Also see the User’s Guide, page 10 in chapter “Getting Started” ftp://root.cern.ch/root/doc/chapter2.pdf

Cheers, Ilka

I check UserGuide Chaper 2 at page 10. But I didn’t find what I need there.

Strange, there is written how to run your scripts/macros in batch mode. For example:

root -b -q $ROOTSYS/tutorials/graphics/latex2.Cwill create the file latex2.ps in a way you explained in your post.

Cheers, Ilka

root.cern.ch/root/roottalk/roottalk00/0402.html

I give an example in Python:

from ROOT import TCanvas, TF1, gROOT, gSystem, kTRUE

gROOT.SetBatch(kTRUE)
c1=TCanvas("c1","JPEG in batch", 800,600)
f1=TF1("func1","sin(x)/x",0,10.)
f1.Draw()
c1.Print("c1.eps")
gSystem.Exec("pstopnm -ppm -xborder 0 -yborder 0 -portrait c1.eps")
gSystem.Exec("ppmtojpeg c1.eps001.ppm > c1.jpg")

Well, you did not specify it in your post. I agree in this case.

Cheers, Ilka

Thanks again. I’m sorry that I didn’t explain my question clearly.

Hi,
the example you mentioned (root.cern.ch/root/roottalk/roottalk00/0402.html )
is obsolete. Now you can use:
c1->Print(“c1.jpg’) or c1->Print(“c1.png’) etc. methods
” to generate a bunch of outputs (PDF, PNG or othe formats) without display them”

Regards. Valeriy