Hi everyone,
I’d like to make a legend for the plot of my stacked histograms using TLegend but i am having trouble placing it. I tried to search the documentation but I couldn’t find what the arguments of the TLegend are. Anyone could explain to me what they mean?
I also have another problem. When I plot my stacked histogram the legend of the single histogram (hRie in the attached figure) remains in the top right corner. I’d like to remove it. Anyone knows how i could do it?
Electron_pT_stacked_RctIso.pdf (16.3 KB)
I also attach a snippet of my code as well. Thanks in advance for the help.
d[0]->cd();
hs[7]->Draw();
hs[7]->GetXaxis()->SetTitle("p_{T} [GeV]");
hs[7]->GetYaxis()->SetTitle("Events/GeV");
auto legend_ele = new TLegend(0.9,0.7,0.48,0.9);
legend_ele->AddEntry(hRi[0],"Electron Events","f");
legend_ele->AddEntry(hRi[2],"Muon Events","f");
legend_ele->AddEntry(hRi[4],"Tau Events","f");
legend_ele->Draw();
d[0]->Modified();
ROOT Version: 6.11/02