Re: [ROOT] Histograms on TCanvas without space between them

From: Olivier Couet (
Date: Tue Apr 06 2004 - 16:37:58 MEST


 Have you a little example illustrating your problem ?

 Cheers,       Olivier

On Tue, 6 Apr 2004, Kay Ulbrich wrote:

> Hello,
> 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,
> Kay

Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                     Mailbox: J25910      
E-Mail:                            Phone:   +41 22 7676522
WWW:                    Fax:     +41 22 7677155

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