class_docstr: This is the matplotlib based GUI for a single analysis
  It assumes the analysis is simple image data (this could be abstracted)
class_docstr_tok: ["This","is","the","matplotlib","based","GUI","for","a","single","analysis","It","assumes","the","analysis","is","simple","image","data","(","this","could","be","abstracted",")"]
docstr: Return the scatter plot as an image in a buffer
docstr_tok: ["Return","the","scatter","plot","as","an","image","in","a","buffer"]
code: def get_figure_as_buffer(self):
      """Return the scatter plot as an image in a buffer"""
      self.force_refresh()
      buf = io.BytesIO()
      extent = self.scatter.get_tightbbox(
          self.fig.canvas.get_renderer()
      ).transformed(self.fig.dpi_scale_trans.inverted())
  
      self.fig.savefig(buf, bbox_inches=extent)
      self.force_refresh()
      return buf
  
imports: import io
  from enum import Enum
  import numpy
  import matplotlib.pyplot
  import matplotlib.style
  from matplotlib.widgets import RectangleSelector, LassoSelector, EllipseSelector, PolygonSelector
  from matplotlib.path import Path
  from matplotlib.backends.backend_qt5agg import FigureCanvas
  from matplotlib.figure import Figure
  from PyQt5 import QtWidgets, QtCore
  from cursors import DrawingCursors, DrawingShape, DrawingMode
label_desc: Use image node_id 21 for calling the EmbeddingGui obj's underlying member method code with example usage: obj.get_figure_as_buffer() and returns: buf