def trim(self, n='<STR_LIT:all>', x=True, y=True):
if len(self._set_xdata)==<NUM_LIT:0> or len(self._set_ydata)==<NUM_LIT:0>:<EOL><INDENT>self._error("<STR_LIT>")<EOL>return<EOL><DEDENT>if _s.fun.is_a_number(n): n = [n]<EOL>elif isinstance(n,str):   n = list(range(len(self._set_xdata)))<EOL>for i in n:<EOL><INDENT>try:<EOL><INDENT>if x:<EOL><INDENT>xmin, xmax = _p.figure(self['<STR_LIT>']+i).axes[<NUM_LIT:1>].get_xlim()<EOL>self['<STR_LIT>'][i] = xmin<EOL>self['<STR_LIT>'][i] = xmax<EOL><DEDENT>if y:<EOL><INDENT>ymin, ymax = _p.figure(self['<STR_LIT>']+i).axes[<NUM_LIT:1>].get_ylim()<EOL>self['<STR_LIT>'][i] = ymin<EOL>self['<STR_LIT>'][i] = ymax<EOL><DEDENT><DEDENT>except:<EOL><INDENT>self._error("<STR_LIT>"+str(i)+"<STR_LIT>")<EOL><DEDENT><DEDENT>self.clear_results()<EOL>if self['<STR_LIT>']: self.plot()<EOL>return self<EOL>
This will set xmin and xmax based on the current zoom-level of the
figures.

n='all'     Which figure to use for setting xmin and xmax.
            'all' means all figures. You may also specify a list.
x=True      Trim the x-range
y=True      Trim the y-range