code: def export(self, fileName=None):
      if not isinstance(self.item, PlotItem):
          raise Exception(
              "MatplotlibExporter currently only works with PlotItem"
          )
  
      mpw = MatplotlibWindow()
      MatplotlibExporter.windows.append(mpw)
  
      fig = mpw.getFigure()
  
      xax = self.item.getAxis("bottom")
      yax = self.item.getAxis("left")
  
      # get labels from the graphic item
      xlabel = xax.label.toPlainText()
      ylabel = yax.label.toPlainText()
      title = self.item.titleLabel.text
  
      # if axes use autoSIPrefix, scale the data so mpl doesn't add its own
      # scale factor label
      xscale = yscale = 1.0
      if xax.autoSIPrefix:
          xscale = xax.autoSIPrefixScale
      if yax.autoSIPrefix:
          yscale = yax.autoSIPrefixScale
  
      ax = fig.add_subplot(111, title=title)
      ax.clear()
      self.cleanAxes(ax)
      for item in self.item.curves:
          x, y = item.getData()
          x = x * xscale
          y = y * yscale
  
          opts = item.opts
          pen = fn.mkPen(opts["pen"])
          if pen.style() == QtCore.Qt.PenStyle.NoPen:
              linestyle = ""
          else:
              linestyle = "-"
          color = pen.color().getRgbF()
          symbol = opts["symbol"]
          symbol = _symbol_pg_to_mpl.get(symbol, "")
          symbolPen = fn.mkPen(opts["symbolPen"])
          symbolBrush = fn.mkBrush(opts["symbolBrush"])
          markeredgecolor = symbolPen.color().getRgbF()
          markerfacecolor = symbolBrush.color().getRgbF()
          markersize = opts["symbolSize"]
  
          if (
              opts["fillLevel"] is not None
              and opts["fillBrush"] is not None
          ):
              fillBrush = fn.mkBrush(opts["fillBrush"])
              fillcolor = fillBrush.color().getRgbF()
              ax.fill_between(
                  x=x, y1=y, y2=opts["fillLevel"], facecolor=fillcolor
              )
  
          ax.plot(
              x,
              y,
              marker=symbol,
              color=color,
              linewidth=pen.width(),
              linestyle=linestyle,
              markeredgecolor=markeredgecolor,
              markerfacecolor=markerfacecolor,
              markersize=markersize,
          )
  
          xr, yr = self.item.viewRange()
          ax.set_xbound(xr[0] * xscale, xr[1] * xscale)
          ax.set_ybound(yr[0] * yscale, yr[1] * yscale)
  
      ax.set_xlabel(xlabel)  # place the labels.
      ax.set_ylabel(ylabel)
      mpw.draw()
  
file_path: pyqtgraph/pyqtgraph/exporters/Matplotlib.py
imports: from ..None import PlotItem
  from ..None import functions
  from ..Qt import QtCore, QtWidgets
  from .Exporter import Exporter
label_desc: Use image node_id 4 for calling the MatplotlibExporter obj's underlying member method code with example usage: obj.export(fileName) without return types