code: def _write_bitmaps(self, path, suffix=''):
          
          dir, prefix = os.path.split(path)
          if '.' in prefix:
              prefix = prefix.split('.')[0]
          if prefix == '':
              prefix = 'figure'
          for i, bitmap in enumerate(self.bitmap_list):
              name = '%s%s_%d.png' % (prefix, suffix, i)
              bitmap['name'] = name
              img = bitmap['image']
              # Make the bitmap at least 1000x1000 pixels
              size0 = int(np.ceil(1000. / img.size[0]) * img.size[0])
              size1 = int(np.ceil(1000. / img.size[1]) * img.size[1])
              large_img = img.resize((size0, size1))
              large_img.save(os.path.join(dir, name))
docs: Write bitmap file assets.
  
          :param path: path of the plot file.
          :param suffix: optional suffix to add to asset names.
  
          The path parameter is used for the dirname, and the filename.
          So if :meth:`save` is called with '/foo/myplot.tex', you can call
          this method with that same path. The assets will then be saved in
          the /foo directory, and have a name like 'myplot_0.png'.