DrawClonePad

Hello,

I draw a THStack and change the x axis range with SetRangeUser. This
canvas I duplicate with DrawClonePad, but then the x axis range I set
ist gone. Here a simple example:

THStack stack("stack","stack")
TH1F * h1 = new TH1F("h1","h1", 100, 0, 29)
TH1F * h2 = new TH1F("h2","h2", 100, 0, 29)
h1->Fill(1)
h2->Fill(1)
h2->Fill(3)
stack.Add(h1)
stack.Add(h2)
TCanvas c1
stack.Draw("hist")
stack.GetXaxis()->SetRangeUser(0,5)
c1.Modified()

TCanvas c2
c1.DrawClonePad()

In canvas c2 the stack has not the x axis range which it has in c1.

Does anybody know how I can use DrawClonePad in that way, that
it conserves the xaxis range? Or is there any workaround?

I am using Root 5.20., could someone tell me if this “problem” is also present in a newer root version?

Thanks,
Thomas

I ran your macro on linux using the ROOT version 5.29 and, for me, the two canvases look exactly the same. It might be you are running an old ROOT (5.20) having this problem.

Hello,

I changed my root version to Root 5.26 now, and that fixed the problem for me too. Thanks for checking.

cheers,
Thomas