The difference for dividing TPad

I find that there are some differences :

  1. I divide the pad p1->Divide(4,1,0,0) then p1->SetBottomMargin(0.2);

2.p1->SetBottomMargin(0.2) then p1->Divide(4,1,0,0)

For these two method , the distance for the Bottom to canvas will be different. I don’t know the reason.
Thank you very much!

Hi,

After p1->Divide(4,1,0,0) change of margin in the canvas does not affect already created sub-pads.

If you configure bottom margin before calling TPad::Divide() method, new value will be used also for new sub-pads. Therefore you are see difference - normally default margin value is 0.1.

Regards,
Sergey

Oh… I just consider that p1->Divide(4,1,0,0) will set the margin to 0. As for your opion , does the SetBottomMargin(0.2) will covert the new value like 0.2 to Divide() function?

Hi,

Margins in the pad defines space between pad boundaries and frame where histograms are drawn.

Then you call Divide, margin parameters have other meaning - it is space which remains empty when creating new sub-pads. Therefore p1->SetBottomMargin(0.2) does not affect position and size of subpads, but rather affects drawing of histograms in these subpads later.

Regards,
Sergey

OK, thank you very much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.