DrawClone and TGraph pad selection fail

Dear Experts,

I’m having some pain using ROOT 5-34-30.
The following sequence of commands doesn’t work:

TCanvas *canv=new TCanvas(...); canv->Divide(2,1); TH1D *histo=new TH1D(...); histo->FillRandom("gaus"); canv->cd(1); histo->DrawClone(); TGraph *graph=new TGraph(histo); canv->cd(2); graph->DrawClone();

I suppose the issue is related to the directory, but it seems to me the Clone is not created in the directory I would expect.
What is wrong with my code? And how can I change the directory of a TGraph?

Thanks in advance, have fun

gf

Instead of a code sketch can you post a running sample ?
Thanks.

Dear couet,

You’re right. Here two samples.
DrawTest.C is alright.
DrawCloneTest.C reproduces my issue.

Best regards

gf
DrawCloneTest.C (351 Bytes)
DrawTest.C (341 Bytes)

I get exactly the same pictures from both your macros (ROOT 5-34-30).

Thank you for your report Wile, there must be something wrong with my root installation or settings.
I didn’t get the graph print in the second example (using DrawClone).

Have fun

gf

Try:
graph->DrawClone(“AL”);

Hello all,

I’ve managed to get the result simply using Draw() instead of DrawClone().

DrawClone(“AL”) did not do the trick anyway.

Many thanks for your support, have fun

gf