xmin=data['x'].min()
xmax=data['x'].max()
xdiff = (xmax-xmin)*0.05 # 5%

ymin=data['y'].min()
ymax=data['y'].max()
ydiff = (ymax-ymin)*0.05 # 5%

ax.set_xlim(xmin=xmin-xdiff, xmax=xmax+xdiff)

ax.set_ylim(ymin=ymin-ydiff,ymax=ymax+ydiff)

Advertisements