Superimposion of two histograms with different scales

I try to plot two functions with different scales on one canvas. The following is my macro to do that. I have read the example “twoscales.C”. Since it is not for a general case, but I dont think it is a good sample. For my case, I am pretty sure that scale of the second function is not correct (the function line is shifted lower). But I cannot figure out the problem. Anybody can help?

ROOT: Version 5.08/00
Linux Mandrake 10.2
plot_resolution.C (1.16 KB)

I think you need what the example transpad.C is doing. IE: draw one histo in one pad and a 2nd one on top in an other pad with a different coordinates system.

Thanks. Yeah, this is the easier way to superimpose.