# Splitting a canvas with different size

Hi, I want to split a canvas into 4 blocks. I see an example in here:
https://root.cern.ch/root/html/tutorials/graphs/zones.C.html
However I want the first row to take 80% and 2nd row to take 20% of the space.
Also there should not be any space left in between two rows.
Any help?

The zones.C example uses `TPad::Divide()`.
This method is a quick way to split a canvas in equal areas. If your Pads’ layout is not equally space you should create the pads yourself at the positions you need.

Hi, thank you for quick response. I tried the following way:
In one canvas, I put TPad1 and split it into 2 subTPads.
My desired format is:

One possible solution is to define 4 such TPads. But I was wondering whether it is possible to use two TPads each divided into two or by canvas splitting.

The solution you end up with looks fine.
I am not sure I understand what is the problem now.
The ratio (80%, 20%) is along the Y axis (vertically) ?

Yes the ratio is along Y-axis.
With 4 defined TPads there is no problem, but if I want to use 2 TPads each splitted into 2, then there is problem.

| 0000000000000000000000 | 000000000000000000000000000 |
| 0000000000000000000000 | 000000000000000000000000000 |

But if I define only 2 TPads and each one is splitted into 2 more then its coming as follow:

| 0000000000000000000000 | 000000000000000000000000000 |
| 0000000000000000000000 | 000000000000000000000000000 |
BLANK BLANK BLANK BLANK …
BLANK BLANK BLANK BLANK | 00 TPad21 000 | 000 TPad22 00 |
BLANK BLANK BLANK BLANK …

``````{
TCanvas *c = new TCanvas("c", "c", 800,800);
c->Draw();
p1->Draw();
p1->Divide(2,1);
p11->SetFillColor(kRed);
p11->Draw();
p12->SetFillColor(kRed-1);
p12->Draw();

c->cd(0);
p2->Draw();
p2->Divide(2,1);
p21->SetFillColor(kBlue);
p21->Draw();