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

  ymin, ymax = ylim()   # return the current ylim
  ylim( (ymin, ymax) )  # set the ylim to ymin, ymax
  ylim( ymin, ymax )    # set the ylim to ymin, ymax

If you do not specify args, you can pass the *ymin* and *ymax* as
kwargs, eg.::

  ylim(ymax=3) # adjust the max leaving min unchanged
  ylim(ymin=1) # adjust the min leaving max unchanged

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