def xlim(*args, **kwargs):
ax = gca()<EOL>ret = ax.set_xlim(*args, **kwargs)<EOL>draw_if_interactive()<EOL>return ret<EOL>
Set/Get the xlimits of the current axes::

  xmin, xmax = xlim()   # return the current xlim
  xlim( (xmin, xmax) )  # set the xlim to xmin, xmax
  xlim( xmin, xmax )    # set the xlim to xmin, xmax

If you do not specify args, you can pass the xmin and xmax as
kwargs, eg.::

  xlim(xmax=3) # adjust the max leaving min unchanged
  xlim(xmin=1) # adjust the min leaving max unchanged

The new axis limits are returned as a length 2 tuple.