[ROOT] Histograms on TCanvas without space between them

From: Kay Ulbrich (ulbrich@iskp.uni-bonn.de)
Date: Tue Apr 06 2004 - 15:49:47 MEST


there was a similar thread some time ago about creating simple
"PAW-style" plots, i.e., histograms stacked right one above the other
and one next to the other without space between them, thus making them
share axes: 

Following the advices, I am able to generate such figures
by using TCanvas::Divide(nx, ny, 0, 0) and in sub pads the
TAttPad::Set[Left,Right,Top,Bottom]Margin(0) - functions in an
appropriate manner.

However, as the histograms "outside" have to have axes and axis
labels, they will be narrower than the ones inside. If only four
histograms are arranged 2x2, this is no problem, all histograms can be
"trimmed" symmetrically. But if "inner" histograms exist, they
invariably will be bigger than the outer ones, because all the margins
of the pads containing them have to be set to 0 in order for them to
touch the neighbouring histograms.

Is there a straightforward way to avoid this? 

Furthermore, I could find no way of taking the thus generated figure
and then adding margins to the figure as a whole without changing the
size ratios of the histograms in the figure. I would need such margins
in order to add axis titles common to all x- or y-axes, thus placing
them relative to the coordinates of a structure containing the figure
with all the histograms. My first guess was, to draw the old TCanvas
in a new one via DrawClone() and then setting the margins of the new
TCanvas appropriately. This did not work.

Maybe I am doing something simple in a too complicated manner?

Thank you for hints,

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET