Hello,
I created a TLegend in PyROOT it displays fine in the canvas but when I want to interact with the canvas (e.g simply clicking on the canvas) the legend vanishes. I tried leg.DrawClone() with no difference.
Any ideas what I am doing wrong?
Thanks,
Sebastien
leg = TLegend(.63,.62,.97,.93)
leg.SetBorderSize(0)
leg.SetFillColor(0)
leg.SetFillStyle(0)
leg.SetTextFont(42)
leg.SetTextSize(0.035)
leg.SetHeader("prim. photon energy","C")
leg.AddEntry(hLStep[idx_1],"40 keV")
leg.AddEntry(hLStep[idx_2],"110 keV")
leg.AddEntry(hLStep[idx_3],"290 keV")
#step length histo
c1= TCanvas("c1","c1",200, 10, 1200, 500)
#c1.Divide(2)
c1.cd()
c1.SetLogy()
hLStep[idx_1].Draw("hist")
hLStep[idx_2].Draw("hist,same")
hLStep[idx_2].SetLineColor(kBlue)
hLStep[idx_3].Draw("hist,same")
hLStep[idx_3].SetLineColor(kRed)
leg.Draw()
c1.Update()
ROOT.gApplication.Run()
ROOT Version: 6.10.08
Platform: mac OS 10.13.6
Compiler: none (Python)