twoscales.C: red axis disappears while zooming

I need to superimpose two histograms with different scales in the same pad. There is an example twoscales.C in the tutorials which does this, but the problem there is that when I zoom the x-axis with the mouse the right red axis goes away. How do I modify the script in order to keep this axis in the same position even after zooming?

An idea which came to my mind is to use TCanvas::AddExec() and redraw the axis each time I make a zoom, but it seems there should be more elegant way to do it.

Thank you.

The red axis is drawn at the maximum X pad value when the macro is executed. Then if you zoom the xmax changes but not the red axis position. The new position (after zooming) should be taken into account. And you are right, the only way would be to put the axis drawing inside a TExec.