'Set limits that constrain the possible view ranges.
**Panning limits**. The following arguments define the region within the
viewbox coordinate system that may be accessed by panning the view.
xMin        Minimum allowed x-axis value
xMax        Maximum allowed x-axis value
yMin        Minimum allowed y-axis value
yMax        Maximum allowed y-axis value
**Scaling limits**. These arguments prevent the view being zoomed in or
out too far.
minXRange   Minimum allowed left-to-right span across the view.
maxXRange   Maximum allowed left-to-right span across the view.
minYRange   Minimum allowed top-to-bottom span across the view.
maxYRange   Maximum allowed top-to-bottom span across the view.
Added in version 0.9.9'

def setLimits(self, **kwds):

    update = False
    allowed = ['xMin', 'xMax', 'yMin', 'yMax', 'minXRange', 'maxXRange', 'minYRange', 'maxYRange']
    for kwd in kwds:
        if (kwd not in allowed):
            raise ValueError(("Invalid    keyword    argument    '%s'." % kwd))
    for axis in [0, 1]:
        for mnmx in [0, 1]:
            kwd = [['xMin', 'xMax'], ['yMin', 'yMax']][axis][mnmx]
            lname = ['xLimits', 'yLimits'][axis]
            if ((kwd in kwds) and (self.state['limits'][lname][mnmx] != kwds[kwd])):
                self.state['limits'][lname][mnmx] = kwds[kwd]
                update = True
            kwd = [['minXRange', 'maxXRange'], ['minYRange', 'maxYRange']][axis][mnmx]
            lname = ['xRange', 'yRange'][axis]
            if ((kwd in kwds) and (self.state['limits'][lname][mnmx] != kwds[kwd])):
                self.state['limits'][lname][mnmx] = kwds[kwd]
                update = True
    if update:
        self.updateViewRange()
