Superimposing 2 TGraphs with different scales

Dear pyroot experts,

I would like to superimpose 2 TGraphs with different scales in pyroot.

I found a nice example in ROOT tutorial : see for example : … woGraphs.C
It works nicely with my root setup :

When simply converting this examples in pyroot, I am answered :
TCanvas::DrawFrame:0: RuntimeWarning: Drawframe must be called for the current pad only

I attached my pyroot macro.
The offending line is obviously the line 22. Do you understand why it works in ROOT but not in pyroot?

Is there any solution?

Many thanks in advance for your help,

Benjamin Trocmé
ATLAS Grenoble (1.71 KB)


the warning is there for root.exe as well, so no difference:root [0] Processing superImposeTwoGraphs.C... Warning in <TCanvas::DrawFrame>: Drawframe must be called for the current pad only root [1] .q
I don’t know what the warning means, though.


Hello Wim,

Thanks for your feedback. I indeed did not notice this in C.
I was just confused by the fact that in pyroot the 2nd graph did not appear; one just needs to update the canvas to see the 2nd graph (whereas it is not needed in C).

Just a stupid beginner error.