TCanvas::DrawClonePad() ignores axis ranges

Dear experts,

I draw a TH1 or THStack into a TCanvas and apply some formatting, e.g. setting axis ranges. If I create a copy of the canvas via DrawClone or DrawClonePad the axis ranges are converted back to the original range. Is there any way to prevent this behavior?



I just tried. It seems ok for me.
Do you have a small example showing what is wrong ?


sorry my question turned out to be wrong. It’s not a TH1, but rather a TEfficiency (or TGraphAsymmErrors) issue. I attached some example which shows the problem. If one clones the canvas the axis is set back to the range of the object first drawn. I’m not sure if this is a problem of TGraph or a problem that I don’t draw the object with widest range first (the real world example is quite a bit more complicated such that it is non trivial to do that).

test.cxx (392 Bytes)

Looking at the ::Paint method of TEfficiency I can see that the histograms/graphs use to paint the result are redone each the TEfficiency is painted. I guess that’s why the range is not kept after a clone. I Let the author of this class answer.