Splitting a canvas into (4x3), with a space between the first two rows

Hi,

By using:
TCanvas *c1= new TCanvas(“c1”,title,65,50,1900,1500);
c1->Divide(4,3,0,0);

-I could get a 4x3 multiplot. But, now I want to put a space between the 1st row and the 2nd row (see the attached file).

___


ROOT Version: 5.34/36
Platform: Not Provided
Compiler: Not Provided


You may use https://root.cern/root/html534/TAttPad.html#TAttPad:SetBottomMargin

{
    TCanvas *c1= new TCanvas("c1","",65,50,1900,1500);
    c1->Divide(4,3,0,0);
    for (int i = 1; i <= 4; i++)
        c1->cd(i)->SetBottomMargin(0.1);

    TH1D h("", "", 10, 0, 10);
    h.SetStats(0);
    for (int i = 1; i <= 4 * 3; i++)
        c1->cd(i), h.DrawClone();
}


But this won’t give you uniform height.

Hi berserker,

Thanks for your reply. But, each panel has to be like a square. I guess only way out is to set TPads accordingly inside a canvas.

There is an example here:
https://root.cern/doc/master/canvas2_8C.html

Hi couet,

Thanks for your suggestion.

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