Divide a canvas with only xmargin at 0

I divided a TCanvas in 4x9 pads

TCanvas *c = new TCanvas("c","c"); c->Divide(4,9);
I would like to remove the space between each line but keep in the same time the space between the column. So I tried to do

but I remarked that it does not work; I mean that if I type that line, I have no margin anymore in x and y whereas I should have a margin in y.
Do I something wrong?
Thanks in advance.

may be you can try:

root [0] TCanvas *c = new TCanvas("c","c");
root [1] c->Divide(4,4,0.0001,0.01,2);

No it does not work. To be more precise, this reduces the margin but the result is different of c->Divide(4,4,0,0). In fact, if I put 0 for the xmargin, the result is that the axis of the pads are not display anymore ( they are hidden by the other pad)
If I use your command, there is no margin between pad but there is still the axis. If it is not clear, I can attach figure

Do not put exactly “0” (nor any negative value) as the “[xy]margin” -> use an artificially small positive number -> something like “0.000001”.
For the special case of “0” (and/or any negative value) as the “[xy]margin” see the TPad::Divide method description.

I tried to put a very small number. There is no space between all the pads but it is not exactly what I want. In fact, if I put 0 in c->Divide, the axis are not displayed (they are hidden by the neighbouring pads). So, I would like to “remove” the X axis and keep the Y axis.

If I put a very small number, X and Y axes are still there.

At some point I wrote a macro giving more control on the canvas division (see attachement). It do not use the Divide() method therefore you can customise it as you wish.
div2.C (1.55 KB)

Thanks for your help. I got what I want with that code

TCanvas *c = new TCanvas(“c”,“c”);

for(int i=0 ; i<4*9 ; i++) {
TH1F *h = new TH1F(TString::Format(“h%d”,i),TString::Format(“h%d”,i),100,0,10);
if(i<32) {
So I needed to put, “c->Divide(4,9,0.01,0.00001,2);”, and to modify top and bottom margins in all pads.