Hello,
I would like to obtain the height of a frame (the fY2 variable in the Inspector) given just a canvas. I have tried various combinations of:
fY2 = canvas -> GetSelectedPad() -> GetFrame() -> GetY2()
For example, in the code below, the value of frame_fy2 should be about 700.
Thanks a lot!!
Pat
main()
{
c1 = new TCanvas("c1","Test Canvas",200,10,600,400);
c1 -> Divide(1,1,0.01,0.01);
// Create histogram
TH1F* hist = new TH1F("h1","Random Gaussian",50,-4,4);
hist->FillRandom("gaus",10000);
// Plot
c1 -> cd(1);
hist -> SetMarkerStyle(20);
hist -> DrawCopy("P");
hist -> SetDirectory(NULL);
// Does not work
Float_t frame_fy2;
frame_fy2 = ( (c1 -> GetSelectedPad()) -> GetFrame() ) -> GetY2();
} //main