

def exec_file(self):
    print('running {0}'.format(self.filename))
    plt.close('all')
    my_globals = {
        'pl': plt,
        'plt': plt,
    }
    execfile(self.filename, my_globals)
    fig = plt.gcf()
    fig.canvas.draw()
    pngfile = op.join(self.target_dir, self.pngfilename)
    thumbfile = op.join('example_thumbs', self.thumbfilename)
    fig.html = ('<img src=../%s>' % self.pngfilename)
    fig.savefig(pngfile, dpi=75, bbox_inches='tight')
    (cx, cy) = self.thumbloc
    create_thumbnail(pngfile, thumbfile, cx=cx, cy=cy)

dataset/ETHPy150Open scikit-beam/scikit-beam/doc/sphinxext/plot_generator.py ExampleGenerator.exec_file/VarMisuse@98/127 `self`->`fig`