If you do not want to cut the labels on h1 and h2 you should do
something like that:
{
TCanvas *c = new TCanvas("c","c",0,0,500,800);
c->Divide(1,3,0,0);
c->cd(1);
h1->SetLabelOffset(1.0,"x");
c_1->SetBottomMargin(0.04);
h1->Draw();
c->cd(2);
h2->SetLabelOffset(1.0,"x");
c_2->SetTopMargin(0.0);
c_2->SetBottomMargin(0.04);
h2->Draw();
c->cd(3);
h3->SetLabelOffset(0.005,"x");
c_3->SetTopMargin(0.0);
h3->Draw();
}
From: owner-roottalk_at_pcroot.cern.ch
[mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Ann-Cecilie Larsen
Sent: Friday, February 16, 2007 1:32 PM
To: RootTalk
Subject: [ROOT] Drawing histograms close together
Dear Rooters,
I am trying to draw three histograms very close together in the vertical direction. In my script, I use:
c1->Divide(1,3);
c1->cd(1);
h1->SetLabelOffset(1.0,"x");
c1_1->SetBottomMargin(0.001);
h1->Draw();
c1->cd(2);
h2->SetLabelOffset(1.0,"x");
c1_2->SetTopMargin(0.0);
c1_2->SetBottomMargin(0.0);
h2->Draw();
c1->cd(3);
h3->SetLabelOffset(0.005,"x");
c1_3->SetTopMargin(0.0);
h3->Draw();
But the result is not very nice, the x axis of pad 1 (and 2) is sort of
cut off, so only the ticks are visible.
Also, the histograms are not placed near eachother, but still have some
white space between them.
How can I draw them nicely together?
Thanks in advance,
Cecilie
This archive was generated by hypermail 2.2.0 : Fri Feb 16 2007 - 23:50:01 CET