I am writing a root macro which produces a canvas with some circles drawn in it, and saves it to a new root file. The only thing that bothers me is that when I run the macro it displays the canvas.
Is it possible to draw the canvas only in the new root file and not display it?
I fill canvases into a branch in a tree and then I write the tree. I’m just interested in saving the canvases, I don’t want to display them. In the canvas there’re a TGraph instance and its fit function.
When I use
as suggested, effectively there’s no pop up window from any canvas but at the same time then when I load the output tree with the canvas branch, all the canvases exist but they’re empty, i.e. there’re neither graph points nor function in it (on the display). So, the batch mode is not only stopping the canvases from displaying but it also empties the content of the canvas.
A possible reason may be that I save the graph and its fit function into the canvas by using the Draw() command
I looked up and tried to find a drawing option to prevent poping up but I didn’t find anything (perhaps because Draw() is meant to display a plot). Any suggestion? How could I save TGraph, TF1, TH1 instances in a canvas without displaying it nor discarding the content (as it’s happing on kTRUE batch mode)?
Hello,
I encounter the same problem. I create canvases only to paste histograms on them and save them as pdf files. It is disturbing to see tens of canvases popping on and off the screen.
However, I don’t work inside Root, I use g++ to compile my code.
Consequently my compiler does not recognise an object called gROOT.