class_docstr: Implements a Matplotlib figure inside a QWidget.
  Use getFigure() and redraw() to interact with matplotlib.
  
  Example::
  
      mw = MatplotlibWidget()
      subplot = mw.getFigure().add_subplot(111)
      subplot.plot(x,y)
      mw.draw()
code: def __init__(self, *args, **kwargs):
      if args and not isinstance(args[0], QtWidgets.QWidget):
          figsize = (
              args[0]
              if len(args) > 0
              else kwargs.get(
                  "figsize", MatplotlibWidget.figsize_default
              )
          )
          dpi = (
              args[1]
              if len(args) > 1
              else kwargs.get("dpi", MatplotlibWidget.dpi_default)
          )
          parent = (
              args[2]
              if len(args) > 2
              else kwargs.get("parent", MatplotlibWidget.parent_default)
          )
      else:
          parent = (
              args[0]
              if len(args) > 0
              else kwargs.get("parent", MatplotlibWidget.parent_default)
          )
          figsize = (
              args[1]
              if len(args) > 1
              else kwargs.get(
                  "figsize", MatplotlibWidget.figsize_default
              )
          )
          dpi = (
              args[2]
              if len(args) > 2
              else kwargs.get("dpi", MatplotlibWidget.dpi_default)
          )
      super().__init__(parent)
  
      self.fig = Figure(figsize, dpi=dpi)
      self.canvas = FigureCanvas(self.fig)
      self.canvas.setParent(self)
      self.toolbar = NavigationToolbar(self.canvas, self)
  
      self.vbox = QtWidgets.QVBoxLayout()
      self.vbox.addWidget(self.toolbar)
      self.vbox.addWidget(self.canvas)
  
      self.setLayout(self.vbox)
  
file_path: pyqtgraph/pyqtgraph/widgets/MatplotlibWidget.py
imports: from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
  from matplotlib.backends.backend_qtagg import NavigationToolbar2QT
  from matplotlib.figure import Figure
  from ..Qt import QtWidgets
  import typing
label_desc: Use image node_id 3 to create a new MatplotlibWidget object from inherited base classes: QtWidgets with example: obj = MatplotlibWidget()