ginput changes axes limits

In the following code the displayed image is initially displayed with axes
going from 0 to 103, ie there is no white space between the image and the

After the first ginput mouse click the axes limits change to -20 to 120 with
white space between the image and the axes. This is a little disconcerting
if the user is trying to accurately pick points on an image.

if I use ax1.axis('off') the white space disappears but the image changes
size. How do I fix the image size so ginput dosen't rescale it.

import pylab

x1 = pylab.rand(103, 103)
fig1 = pylab.figure(1)
ax1 = fig1.add_subplot(111)
x = fig1.ginput(2)


View this message in context:
Sent from the matplotlib - users mailing list archive at