New line in Title

Hi,

When I make histograms with certain cuts (TCut) the cuts appear in the title box of the histogram:

MyTree->Draw(leave1 + “>>newHisto1”,cut1,"");
newHisto1->Draw();

Some of the titles are too long and the fonts become small and unreadable. Is there a way to get several lines in the title box? Then, by resizing the title box and setting the font it should be possible to read the title again.

Niels

you can change the title plot and write it on several lines with:

ntuple->GetHistogram()->SetTitle("#splitline{aaa}{bbb}")

You can also add as many lines as you need:

{
    gROOT->Reset();

    TH1F *h = new TH1F("h", "first", 100, -10, 10);
    h->FillRandom("gaus");
    h->Draw();
    gPad->Update();

    TPaveText * pt = (TPaveText *)gPad->FindObject("title");
    pt->InsertText("second");
    pt->InsertText("third");
    pt->SetX1NDC(0.05);   pt->SetY1NDC(0.9);
    pt->SetX2NDC(0.75);    pt->SetY2NDC(0.99);
    pt->SetTextSize(0.03);
    pt->Draw();
}