def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs):
if ymax is None and iterable(ymin):<EOL><INDENT>ymin,ymax = ymin<EOL><DEDENT>if ymin is not None:<EOL><INDENT>ymin = self.convert_yunits(ymin)<EOL><DEDENT>if ymax is not None:<EOL><INDENT>ymax = self.convert_yunits(ymax)<EOL><DEDENT>old_ymin,old_ymax = self.get_ylim()<EOL>if ymin is None: ymin = old_ymin<EOL>if ymax is None: ymax = old_ymax<EOL>ymin, ymax = mtransforms.nonsingular(ymin, ymax, increasing=False)<EOL>ymin, ymax = self.yaxis.limit_range_for_scale(ymin, ymax)<EOL>self.viewLim.intervaly = (ymin, ymax)<EOL>if emit:<EOL><INDENT>self.callbacks.process('<STR_LIT>', self)<EOL>for other in self._shared_y_axes.get_siblings(self):<EOL><INDENT>if other is not self:<EOL><INDENT>other.set_ylim(self.viewLim.intervaly, emit=False)<EOL>if (other.figure != self.figure and<EOL>other.figure.canvas is not None):<EOL><INDENT>other.figure.canvas.draw_idle()<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return ymin, ymax<EOL>
call signature::

  set_ylim(self, *args, **kwargs):

Set the limits for the yaxis; v = [ymin, ymax]::

  set_ylim((valmin, valmax))
  set_ylim(valmin, valmax)
  set_ylim(ymin=1) # ymax unchanged
  set_ylim(ymax=1) # ymin unchanged

Keyword arguments:

  *ymin*: scalar
    the min of the ylim
  *ymax*: scalar
    the max of the ylim
  *emit*: [ True | False ]
    notify observers of lim change

Returns the current ylimits as a length 2 tuple

ACCEPTS: len(2) sequence of floats