I have some code that generates a TCanvas, draws a histogram, and then Print()'s the canvas to a .png file.
The TCanvas pops up on the screen which makes the application look unprofessional. I would like to create a .png without the TCanvas popping up on the screen. Can this be done?
ROOT Version: 6.28.04
Platform: Ubuntu 22
You can use batch mode. Just run:
root -b your_macro.C -q
I still want a GUI, I just don’t want loads of random popups everywhere. Is it all or nothing?
You can set batch mode only while you create canvas and store png file:
auto c1 = new TCanvas("c1","c1", 500, 500);
// draw all your objects here
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.