Hi,
Using ROOT v5.18/00 I’m confused about the function of the y-axis of the TH1. It does not appear to do anything.
Using the below macro:
[code]{
gROOT->Reset();
TH1D h(“h”, “h”, 100, 0., 1.);
TCanvas canvas(“canvas”);
h.Fill(.9);
h.Fill(.9);
std::cout << “===========================” << std::endl;
std::cout << “Before drawing:” << std::endl;
std::cout << " h.GetMaximum() = "
<< h.GetMaximum() << std::endl;
std::cout << " h.GetYaxis()->GetXmax() = "
<< h.GetYaxis()->GetXmax() << std::endl;
std::cout << std::endl;
h.Draw();
canvas.Update();
std::cout << “After drawing:” << std::endl;
std::cout << " h.GetMaximum() = "
<< h.GetMaximum() << std::endl;
std::cout << " h.GetYaxis()->GetXmax() = "
<< h.GetYaxis()->GetXmax() << std::endl;
std::cout << " gPad->GetFrame()->GetY2() = "
<< gPad->GetFrame()->GetY2() << std::endl;
std::cout << std::endl;
h.Scale(100.);
h.Draw();
canvas.Update();
std::cout << “After scaling:” << std::endl;
std::cout << " h.GetMaximum() = "
<< h.GetMaximum() << std::endl;
std::cout << " h.GetYaxis()->GetXmax() = "
<< h.GetYaxis()->GetXmax() << std::endl;
std::cout << " gPad->GetFrame()->GetY2() = "
<< gPad->GetFrame()->GetY2() << std::endl;
}[/code]
I get the following output:
[code]===========================
Before drawing:
h.GetMaximum() = 2
h.GetYaxis()->GetXmax() = 1
After drawing:
h.GetMaximum() = 2
h.GetYaxis()->GetXmax() = 1
gPad->GetFrame()->GetY2() = 2.1
After scaling:
h.GetMaximum() = 200
h.GetYaxis()->GetXmax() = 1
gPad->GetFrame()->GetY2() = 210[/code]
I think I’m convinced that the size of the drawn y-axis is a property of the current pad’s frame but what is the y-axis supposed to do?
Cheers,
Jeroen