code: def write_image(self, stream, image_format="svg", **kwargs):
          
          plt = self.get_plot(**kwargs)
  
          f = plt.gcf()
          f.set_size_inches((12, 10))
  
          plt.savefig(stream, format=image_format)
docs: Writes the phase diagram to an image in a stream.
  
          Args:
              stream:
                  stream to write to. Can be a file stream or a StringIO stream.
              image_format
                  format for image. Can be any of matplotlib supported formats.
                  Defaults to svg for best results for vector graphics.
              \\*\\*kwargs: Pass through to get_plot functino.