Dividing a TCanvas such that the plots are the same size

I would like to divide a TCanvas so that I can have multiple plots with no margins between them, as in this example (root.cern.ch/root/html/tutorials … nes.C.html). When you use TCanvas::Divide it divides the canvas into pads and then each plot is drawn in one of these pads. This is problematic because the bottom row and left column need to contain the axes labels and titles so they end up with smaller areas for actual plotting. With a number of divisions this can be an extremely noticeable and undesirable effect. If you try to resize the pads so that the plotting areas are all identical then you end up with the issue that the tick sizes, the label sizes, the label offsets, the title sizes, the title offsets, coordinates for placing legends, etc are all inconsistent between panes and this looks very unprofessional unless corrected. Tweaking all of these values by hand is extremely time consuming but it would also take a lot of work to understand exactly how all of these things scale in order to automate it. This is such a common use case that I would imagine there is either a built in way to deal with this in ROOT or that there is some code floating around that can accomplish the task. Does anybody have such code or know of a non-tedious way to make the plots look as desired?

I think your problem looks like the one discussed in [url=https://root-forum.cern.ch/t/formatting-axis-labels-and-more-on-a-multi-pad-canvas/7428/1 post[/url]. There is also an example in $ROOTSYS/tutorials/graphics/canvas2.C