ylim() efficiency

It seems that resetting the axes limits every time data needs to be redisplayed is rather inefficient.

A script is included with this mail that tests the efficiency of resizing the y axis.

The script has two loops, in the first loop pylab.ylim() is continuously called with the changing

size of the domain, in the second loop pylab.ylim() is not called inside the loop. The first loop takes roughly

twice as long to perform.

Is this an unavoidable cost for resizing the y axis or is there another way to resize the axis that is less costly

than using ylim()?

ylim.py (724 Bytes)