Problem with Text in BuildLegend

Hello,

I’m drawing histograms with the following code, where I use the BuildLegend command and save the files as eps. The legend contains correct information, but the size of the text varies systematically. It seems, that as soon as a bar above a letter (e.g. t#bar t) or a underscore (e.g. WZ_3L) is used, the text size is increased (see attachments). I was unable to set the text size manually and would like to know if this is possible at all and if so, how it could be done. For example, look at the two plots attached. The text size in the legend is different.

Thanks for any help!
Benjamin

A code snipped follows:

    TCanvas *can24 = new TCanvas("can24","ptlep1 2l wh wjets zz",10,10,800,800);
    TCanvas *can6 = new TCanvas("can6","ptlep1 2l wh ttbar wz",10,10,800,800);

    can6->cd();
    THStack* hs6 = new THStack();
    
    signal->cd();
    preplot2L_ptlep0->SetLineColor(kBlack);
    preplot2L_ptlep0->SetMarkerSize(0);
    hs6->Add(preplot2L_ptlep0);
    
    ttbar->cd();
    preplot2L_ptlep0->SetLineColor(kBlue);
    preplot2L_ptlep0->SetMarkerSize(0);
    preplot2L_ptlep0->SetLineStyle(2);
    hs6->Add(preplot2L_ptlep0);

    wz->cd();
    preplot2L_ptlep0->SetLineColor(kGreen);
    preplot2L_ptlep0->SetMarkerSize(0);
    preplot2L_ptlep0->SetLineStyle(3);
    hs6->Add(preplot2L_ptlep0);
    
    hs6->SetMinimum(0);
    hs6->SetMaximum(0.08);
    hs6->Draw("nostack");
    hs6->GetXaxis()->SetTitle("p_{T} [GeV]");
    hs6->GetYaxis()->SetTitle("arb. units");
    hs6->GetYaxis()->SetTitleOffset(1.44);

    can6->BuildLegend();
    TPave* p1=(TPave*)gPad->GetPrimitive("TPave");
    p1->SetFillColor(0);
    can6->Print("pics/ptlep1.eps");

    can24->cd();
    THStack* hs24 = new THStack();

    signal->cd();
    preplot2L_ptlep0->SetLineColor(kBlack);
    preplot2L_ptlep0->SetMarkerSize(0);
    hs24->Add(preplot2L_ptlep0);

    wjets->cd();
    preplot2L_ptlep0->SetLineColor(kMagenta);
    preplot2L_ptlep0->SetMarkerSize(0);
    hs24->Add(preplot2L_ptlep0);

    zz->cd();
    preplot2L_ptlep0->SetLineColor(kCyan);
    preplot2L_ptlep0->SetMarkerSize(0);
    preplot2L_ptlep0->SetLineStyle(9);
    hs24->Add(preplot2L_ptlep0);

    hs24->SetMinimum(0);
    hs24->SetMaximum(0.08);
    hs24->Draw("nostack");
    hs24->GetXaxis()->SetTitle("p_{T} [GeV]");
    hs24->GetYaxis()->SetTitle("arb. units");
    hs24->GetYaxis()->SetTitleOffset(1.44);

    can24->BuildLegend(0.6,0.67,0.98,0.88);
    TPave* p1=(TPave*)gPad->GetPrimitive("TPave");
    p1->SetFillColor(0);
    can24->Print("pics/wh2l_ptlep1_whwjetszz.eps");




Did you try

p1->SetTextSize(0.05); ?

Kris