Altering the size of TCanvas before SaveAs

I’ve got a ROOT file that has a few TCanvas’ in them. They were created with default dimensions 600x400. But when writing out a png file in a script I’d like something a bit larger (say x2 larger). How can I accomplish this in batch mode?

BTW, if I’m in UI mode I can draw the canvas and then it looks like I could use SetWindowSize - but this doesn’t work if there is no window attached to the canvas.

Many thanks!

does it work with: … CanvasSize


[quote=“couet”]does it work with: … CanvasSize


That seems to have no effect, unfortunately.

I tried to follow the logic in the code… rather difficult, with SaveAs calling Print calling SaveAs, but if you follow it down enough it looks like SetCanvasSize should work, but then you note in SetCanvasSize that nothing works if there isn’t an Imp to go along with the canvas. I also discovered that even though “Draw” doesn’t work, I’m not in batch mode. So, in order to not crash, for me, I needed to do the following things:

TCanvas *c = (TCanvas*)f->Get("mycanv");

Sheesh. SetCanvasSize is not obeying the principle of least surprise here.