I want to draw a narrow but high graph. Here is my test macro:
{
gROOT->Reset();
c1 = new TCanvas("c1","canvas",10,0,250,870);
pad = new TPad("", "", 0.0, 0.0, 1.0, 1.0);
pad->SetBottomMargin(0.05);
pad->SetTopMargin(0.01);
pad->Draw();
pad->cd();
Float_t x[3] = {1., 2.2, 3.};
Float_t y[3] = {1., 85.3, 120.};
graph = TGraph(3, x, y);
graph->Draw("AL");
pad->Update();
TAxis * axis = graph->GetXaxis();
axis->SetLabelSize(0.08);
axis->SetLabelOffset(0.);
pad->Modified();
}
The labels of the X - axis are NOT visible in this example because the offset
is more than twice the size of the label characters. Even if I set the offset
to 0.
I want to use as much space as possible for the graph and as less as necessary
for the labels. Therefore I set the BottomMargin to 0.05 which would be enough
for the label size of 0.08.
While I was playing with this example I noticed an other strange behavior:
When you set the labelOffset to a negative value the labels are still painted
below the X - axis. But if you want to open the pop-up menu of the TAxis with
the right mouse button, you have to move your mouse into the graph above the
X-axis.
For example set the labelOffset to -0.1 you have to move the mouse to the Y -
position of approximately 10 in this example to be able to open the TAxis menu.
Cheers Reiner.