Cern root multi panel plots with 0 margins inbetween them

If I want to make a multipanel plot in cern root by dividing the canvas with zero margin between the plots, then the label size of the plots do not match, since the plots in left and the bottom will be drawn with the x and y axis labels but other plots won’t be drawn with it. For Example,

TCanvas *c = new TCanvas();
c->Divide(2,2,0,0); // the 0,0 will set the margin between the pads to be zero
c->SetBottomMargin(0.15);
c->SetLeftMargin(0.15);
for(int i=0; i<4; i++) {
c->cd(i+1);
histogram[i]->Draw();
}

Is there any way, that all the histograms are drawn such that they have size (excluding the space taken by the labels for left and bottom plots)

I tried to manually set different size of labels for each panel in the canvas, but then if I have to change the dimensions of the canvas or divide the canvas in some other number of panels, then I have to manually again set the labels differently for each panel via hit and trail method.

https://root.cern/doc/v630/canvas2_8C.html

1 Like

Thanks for the help. However, I noticed that, when I change the label front type from 43 to 42 and then change the size to (0.07), then the size of the labels in the top left and bottom left plots is not same for 3 cross 2 divided canvas. Why it is the case?

This is the point, the label font should be 43 to have the size in pixels… With 42 the label size is a % of the pad size.

1 Like

Thanks. I got it now.

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