Beispiel #1
0
// write some TLatex text. Return value is new position after the text
double writeLatex(TPad* pad, double x, double y, std::string text, double scale = 1.)
{
    //pad->Update();
    pad->cd();
    TLatex *tl = new TLatex(NDCtoUserX(pad,x), NDCtoUserY(pad,y), text.c_str());
    tl->SetTextSize(.040*scale);
    tl->Draw();
    cout << "latex: " << tl->GetXsize() << " " << tl->GetX() << " " << tl->GetYsize()
         << " pad: " << pad->GetX1() << " " << pad->GetX2() << endl;
    return (x+tl->GetXsize()/(pad->GetX2()-pad->GetX1()));
}