Dear experts,
I am trying to plot three histograms in the same canvas but I always get the last one of them. I don’t understand what I am doing wrong. I leave here the part of the code for plotting the hists.
C = TCanvas()
ht = h2dt.ProjectionY("",14,15)
ht.SetMarkerColor(kRed)
ht.SetLineStyle(1)
ht.SetLineColor(kRed)
ht.SetLineWidth(2)
ht.GetYaxis().SetRangeUser(0,0.75)
ht.SetTitle(";#tau (H_{0}) [ps];Vertex proportion")
ht.SetStats(0)
hd = h2dd.ProjectionY("",14,15)
hd.SetMarkerColor(kBlue)
hd.SetLineStyle(1)
hd.SetLineColor(kBlue)
hd.SetLineWidth(2)
hd.GetYaxis().SetRangeUser(0,0.75)
hl = h2dl.ProjectionY("",14,15)
hl.SetMarkerColor(kBlack)
hl.SetLineStyle(1)
hl.SetLineColor(kBlack)
hl.SetLineWidth(2)
hl.GetYaxis().SetRangeUser(0,0.75)
ht.Draw("HIST")
hd.Draw("SAME HIST")
hl.Draw("SAME HIST")
I also leave the file. I am working with pyroot on lxplus.
gen1d.py (14.0 KB)