def __init__(self, targetfig, toolfig):
self.targetfig = targetfig<EOL>toolfig.subplots_adjust(left=<NUM_LIT>, right=<NUM_LIT>)<EOL>class toolbarfmt:<EOL><INDENT>def __init__(self, slider):<EOL><INDENT>self.slider = slider<EOL><DEDENT>def __call__(self, x, y):<EOL><INDENT>fmt = '<STR_LIT>'%(self.slider.label.get_text(), self.slider.valfmt)<EOL>return fmt%x<EOL><DEDENT><DEDENT>self.axleft = toolfig.add_subplot(<NUM_LIT>)<EOL>self.axleft.set_title('<STR_LIT>')<EOL>self.axleft.set_navigate(False)<EOL>self.sliderleft = Slider(self.axleft, '<STR_LIT:left>', <NUM_LIT:0>, <NUM_LIT:1>, targetfig.subplotpars.left, closedmax=False)<EOL>self.sliderleft.on_changed(self.funcleft)<EOL>self.axbottom = toolfig.add_subplot(<NUM_LIT>)<EOL>self.axbottom.set_navigate(False)<EOL>self.sliderbottom = Slider(self.axbottom, '<STR_LIT>', <NUM_LIT:0>, <NUM_LIT:1>, targetfig.subplotpars.bottom, closedmax=False)<EOL>self.sliderbottom.on_changed(self.funcbottom)<EOL>self.axright = toolfig.add_subplot(<NUM_LIT>)<EOL>self.axright.set_navigate(False)<EOL>self.sliderright = Slider(self.axright, '<STR_LIT:right>', <NUM_LIT:0>, <NUM_LIT:1>, targetfig.subplotpars.right, closedmin=False)<EOL>self.sliderright.on_changed(self.funcright)<EOL>self.axtop = toolfig.add_subplot(<NUM_LIT>)<EOL>self.axtop.set_navigate(False)<EOL>self.slidertop = Slider(self.axtop, '<STR_LIT>', <NUM_LIT:0>, <NUM_LIT:1>, targetfig.subplotpars.top, closedmin=False)<EOL>self.slidertop.on_changed(self.functop)<EOL>self.axwspace = toolfig.add_subplot(<NUM_LIT>)<EOL>self.axwspace.set_navigate(False)<EOL>self.sliderwspace = Slider(self.axwspace, '<STR_LIT>', <NUM_LIT:0>, <NUM_LIT:1>, targetfig.subplotpars.wspace, closedmax=False)<EOL>self.sliderwspace.on_changed(self.funcwspace)<EOL>self.axhspace = toolfig.add_subplot(<NUM_LIT>)<EOL>self.axhspace.set_navigate(False)<EOL>self.sliderhspace = Slider(self.axhspace, '<STR_LIT>', <NUM_LIT:0>, <NUM_LIT:1>, targetfig.subplotpars.hspace, closedmax=False)<EOL>self.sliderhspace.on_changed(self.funchspace)<EOL>self.sliderleft.slidermax = self.sliderright<EOL>self.sliderright.slidermin = self.sliderleft<EOL>self.sliderbottom.slidermax = self.slidertop<EOL>self.slidertop.slidermin = self.sliderbottom<EOL>bax = toolfig.add_axes([<NUM_LIT>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>])<EOL>self.buttonreset = Button(bax, '<STR_LIT>')<EOL>sliders = (self.sliderleft, self.sliderbottom, self.sliderright,<EOL>self.slidertop, self.sliderwspace, self.sliderhspace, )<EOL>def func(event):<EOL><INDENT>thisdrawon = self.drawon<EOL>self.drawon = False<EOL>bs = []<EOL>for slider in sliders:<EOL><INDENT>bs.append(slider.drawon)<EOL>slider.drawon = False<EOL><DEDENT>for slider in sliders:<EOL><INDENT>slider.reset()<EOL><DEDENT>for slider, b in zip(sliders, bs):<EOL><INDENT>slider.drawon = b<EOL><DEDENT>self.drawon = thisdrawon<EOL>if self.drawon:<EOL><INDENT>toolfig.canvas.draw()<EOL>self.targetfig.canvas.draw()<EOL><DEDENT><DEDENT>validate = toolfig.subplotpars.validate<EOL>toolfig.subplotpars.validate = False<EOL>self.buttonreset.on_clicked(func)<EOL>toolfig.subplotpars.validate = validate<EOL>
targetfig is the figure to adjust

toolfig is the figure to embed the the subplot tool into.  If
None, a default pylab figure will be created.  If you are
using this from the GUI