zooming with transforms

What is the most effective approach to perform a 'zoom under mouse
cursor'? Currently I use the following code (considering g as mpl.Axes),
but set_xlim() is called twice. Is there a better approach?

<code>
# First zoom
result = \
g.bbox.shrunk(DEFAULT_ZOOM_FACTOR,1).transformed(g.transData.inverted())
g.set_xlim(*result.intervalx)
# Get the new location of initial event
b = g.transData.transform_point([event.xdata, 0])
# Then replace the original location under the mouse cursor
result = \
g.bbox.translated(-(event.x-b[0]),0).transformed(g.transData.inverted())
g.set_xlim(*result.intervalx)
</code>

Arnaud.