# Divide canvas in to a grid and then merge two pads

**URL:** <https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322>\
**Category:** Newbie\
**Created:** [April 8, 2021, 1:17am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322 "2021-04-08T01:17:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aa5](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f1d935/32.png) [@Aa5](https://root-forum.cern.ch/u/Aa5)\
**Post date:** [April 8, 2021, 1:17am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322/1 "2021-04-08T01:17:02Z")

</div>

ROOT Version: 6.22/03  
Platform: MacOS

Hello,

I would like to divide a canvas to a grid of 3 by 3, and then merge two of pads (#6 and #9). I could not find anything in the “Divide” documentation.

Thanks

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [April 8, 2021, 5:44am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322/2 "2021-04-08T05:44:19Z")

</div>

What exactly do you mean by ‘then merge’? and what about pad 8 located between 7 and 9?  
In any case, you can have more control and not be limited to equal pad sizes if you draw your own pads on a canvas instead of using Divide.

---

<div class="post-metadata">

**Author:** ![Aa5](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f1d935/32.png) [@Aa5](https://root-forum.cern.ch/u/Aa5)\
**Post date:** [April 8, 2021, 10:22am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322/3 "2021-04-08T10:22:36Z")

</div>

Sorry. I did a mistake in calculating. I want to merge #6 and #9.  
What I mean by merging is, I want to have a total of 8 sub-figures: 7 sub-figures will go at cells #1, #2, #3, #4, #5, #7, #8; and 1 sub-figure will go at a merged cell of #6 and #9.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 8, 2021, 10:31am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322/4 "2021-04-08T10:31:30Z")

</div>

That’a not a regular grid. Divide() generates only regular grid. You should define the TPad yourself at the right positions . That’s not to complicated.

---

<div class="post-metadata">

**Author:** ![Aa5](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f1d935/32.png) [@Aa5](https://root-forum.cern.ch/u/Aa5)\
**Post date:** [April 8, 2021, 11:21am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322/5 "2021-04-08T11:21:46Z")

</div>

So I basically define the 8 pads manually without dividing the canvas? (Thanks for your time.)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 8, 2021, 11:33am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322/6 "2021-04-08T11:33:31Z")

</div>

Yes you compute yourself the pads position. As aI said it should not be too complex. I can help if you need.

---

<div class="post-metadata">

**Author:** ![Aa5](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f1d935/32.png) [@Aa5](https://root-forum.cern.ch/u/Aa5)\
**Post date:** [April 8, 2021, 11:38am UTC](https://root-forum.cern.ch/t/divide-canvas-in-to-a-grid-and-then-merge-two-pads/44322/7 "2021-04-08T11:38:30Z")

</div>

Thanks for the help. I did this in the past. I thought there could be an easier way, like table cell merging in Latex.
