Print TPad

In the example attached, I have a canvas which I draw two TPad and then draw a histogram on each Pad.
This all works very well, but when I try to print the TPad to a .png file, the second pad is not printed correctly.
I am not sure why. What am I doing wrong? (368 Bytes)


not sure how this is supposed to work, so the question is probably better posted in the ROOT support forum (given that it’s not a python issue). Basically, the 2nd pad is printed, but it’s just outside the frame of the png display (i.e. the overall boundaries are from the TPad, but the layout is as per the TCanvas).

You can see this clearly if you reset its coordinates before printing: pad2.SetPad(pad2.GetName(), pad2.GetTitle(), 0., 0., 0.5, 1.0)
If I use c.Divide(2, 1) and then cd into the divisions before drawing the Pad, the pad.Print()ed png’s contain the full canvas. Not sure how this is supposed to work, but it seems that the only thing you should print from the top-level are TCanvases. Again, this is beyond me and you will get a more intelligent answer on the ROOT support subforum.


Hello Wim,
Thanks for the reply.

I had noticed the same thing. I will try to ask the question on the other forum.