prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add MultiPlotItem to docs
  I noticed it's missing in reviewing #1324. Also [MultiPlotWidget](https://pyqtgraph.readthedocs.io/en/latest/widgets/multiplotwidget.html) should link to it and indicate it wraps the item's methods. `MultiPlotItem.plot` could also use a docstring.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pyqtgraph/widgets/MultiPlotWidget.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 """
  3 MultiPlotWidget.py -  Convenience class--GraphicsView widget displaying a MultiPlotItem
  4 Copyright 2010  Luke Campagnola
  5 Distributed under MIT/X11 license. See license.txt for more information.
  6 """
  7 from ..Qt import QtCore
  8 from .GraphicsView import GraphicsView
  9 from ..graphicsItems import MultiPlotItem as MultiPlotItem
  10 
  11 __all__ = ['MultiPlotWidget']
  12 class MultiPlotWidget(GraphicsView):
  13     """Widget implementing a graphicsView with a single MultiPlotItem inside."""
  14     def __init__(self, parent=None):
  15         self.minPlotHeight = 50
  16         self.mPlotItem = MultiPlotItem.MultiPlotItem()
  17         GraphicsView.__init__(self, parent)
  18         self.enableMouse(False)
  19         self.setCentralItem(self.mPlotItem)
  20         ## Explicitly wrap methods from mPlotItem
  21         #for m in ['setData']:
  22             #setattr(self, m, getattr(self.mPlotItem, m))
  23         self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
  24         self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
  25                 
  26     def __getattr__(self, attr):  ## implicitly wrap methods from plotItem
  27         if hasattr(self.mPlotItem, attr):
  28             m = getattr(self.mPlotItem, attr)
  29             if hasattr(m, '__call__'):
  30                 return m
  31         raise AttributeError(attr)
  32 
  33     def setMinimumPlotHeight(self, min):
  34         """Set the minimum height for each sub-plot displayed. 
  35         
  36         If the total height of all plots is greater than the height of the 
  37         widget, then a scroll bar will appear to provide access to the entire
  38         set of plots.
  39         
  40         Added in version 0.9.9
  41         """
  42         self.minPlotHeight = min
  43         self.resizeEvent(None)
  44 
  45     def widgetGroupInterface(self):
  46         return (None, MultiPlotWidget.saveState, MultiPlotWidget.restoreState)
  47 
  48     def saveState(self):
  49         return {}
  50         #return self.plotItem.saveState()
  51         
  52     def restoreState(self, state):
  53         pass
  54         #return self.plotItem.restoreState(state)
  55 
  56     def close(self):
  57         self.mPlotItem.close()
  58         self.mPlotItem = None
  59         self.setParent(None)
  60         GraphicsView.close(self)
  61 
  62     def setRange(self, *args, **kwds):
  63         GraphicsView.setRange(self, *args, **kwds)
  64         if self.centralWidget is not None:
  65             r = self.range
  66             minHeight = len(self.mPlotItem.plots) * self.minPlotHeight
  67             if r.height() < minHeight:
  68                 r.setHeight(minHeight)
  69                 r.setWidth(r.width() - self.verticalScrollBar().width())
  70             self.centralWidget.setGeometry(r)
  71 
  72     def resizeEvent(self, ev):
  73         if self.closed:
  74             return
  75         if self.autoPixelRange:
  76             self.range = QtCore.QRectF(0, 0, self.size().width(), self.size().height())
  77         MultiPlotWidget.setRange(self, self.range, padding=0, disableAutoPixel=False)  ## we do this because some subclasses like to redefine setRange in an incompatible way.
  78         self.updateMatrix()
  79
  ```
  
  Path: `pyqtgraph/graphicsItems/MultiPlotItem.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 """
  3 MultiPlotItem.py -  Graphics item used for displaying an array of PlotItems
  4 Copyright 2010  Luke Campagnola
  5 Distributed under MIT/X11 license. See license.txt for more information.
  6 """
  7 from numpy import ndarray
  8 from . import GraphicsLayout
  9 from ..metaarray import *
  10 
  11 
  12 __all__ = ['MultiPlotItem']
  13 class MultiPlotItem(GraphicsLayout.GraphicsLayout):
  14     """
  15     Automatically generates a grid of plots from a multi-dimensional array
  16     """
  17     def __init__(self, *args, **kwds):
  18         GraphicsLayout.GraphicsLayout.__init__(self, *args, **kwds)
  19         self.plots = []
  20 
  21 
  22     def plot(self, data, **plotArgs):
  23         #self.layout.clear()
  24 
  25         if hasattr(data, 'implements') and data.implements('MetaArray'):
  26             if data.ndim != 2:
  27                 raise Exception("MultiPlot currently only accepts 2D MetaArray.")
  28             ic = data.infoCopy()
  29             ax = 0
  30             for i in [0, 1]:
  31                 if 'cols' in ic[i]:
  32                     ax = i
  33                     break
  34             #print "Plotting using axis %d as columns (%d plots)" % (ax, data.shape[ax])
  35             for i in range(data.shape[ax]):
  36                 pi = self.addPlot()
  37                 self.nextRow()
  38                 sl = [slice(None)] * 2
  39                 sl[ax] = i
  40                 pi.plot(data[tuple(sl)], **plotArgs)
  41                 #self.layout.addItem(pi, i, 0)
  42                 self.plots.append((pi, i, 0))
  43                 info = ic[ax]['cols'][i]
  44                 title = info.get('title', info.get('name', None))
  45                 units = info.get('units', None)
  46                 pi.setLabel('left', text=title, units=units)
  47             info = ic[1-ax]
  48             title = info.get('title', info.get('name', None))
  49             units = info.get('units', None)
  50             pi.setLabel('bottom', text=title, units=units)
  51         else:
  52             raise Exception("Data type %s not (yet?) supported for MultiPlot." % type(data))
  53 
  54     def close(self):
  55         for p in self.plots:
  56             p[0].close()
  57         self.plots = None
  58         self.clear()
  59
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/pyqtgraph/graphicsItems/MultiPlotItem.py b/pyqtgraph/graphicsItems/MultiPlotItem.py
  --- a/pyqtgraph/graphicsItems/MultiPlotItem.py
  +++ b/pyqtgraph/graphicsItems/MultiPlotItem.py
  @@ -4,22 +4,33 @@
   Copyright 2010  Luke Campagnola
   Distributed under MIT/X11 license. See license.txt for more information.
   """
  -from numpy import ndarray
   from . import GraphicsLayout
   from ..metaarray import *
   
  -
   __all__ = ['MultiPlotItem']
  +
  +
   class MultiPlotItem(GraphicsLayout.GraphicsLayout):
       """
  -    Automatically generates a grid of plots from a multi-dimensional array
  +    :class:`~pyqtgraph.GraphicsLayout` that automatically generates a grid of
  +    plots from a MetaArray.
  +
  +    .. seealso:: :class:`~pyqtgraph.MultiPlotWidget`: Widget containing a MultiPlotItem
       """
  +
       def __init__(self, *args, **kwds):
           GraphicsLayout.GraphicsLayout.__init__(self, *args, **kwds)
           self.plots = []
   
  -
       def plot(self, data, **plotArgs):
  +        """Plot the data from a MetaArray with each array column as a separate
  +        :class:`~pyqtgraph.PlotItem`.
  +
  +        Axis labels are automatically extracted from the array info.
  +
  +        ``plotArgs`` are passed to :meth:`PlotItem.plot
  +        <pyqtgraph.PlotItem.plot>`.
  +        """
           #self.layout.clear()
   
           if hasattr(data, 'implements') and data.implements('MetaArray'):
  diff --git a/pyqtgraph/widgets/MultiPlotWidget.py b/pyqtgraph/widgets/MultiPlotWidget.py
  --- a/pyqtgraph/widgets/MultiPlotWidget.py
  +++ b/pyqtgraph/widgets/MultiPlotWidget.py
  @@ -10,7 +10,8 @@
   
   __all__ = ['MultiPlotWidget']
   class MultiPlotWidget(GraphicsView):
  -    """Widget implementing a graphicsView with a single MultiPlotItem inside."""
  +    """Widget implementing a :class:`~pyqtgraph.GraphicsView` with a single
  +    :class:`~pyqtgraph.MultiPlotItem` inside."""
       def __init__(self, parent=None):
           self.minPlotHeight = 50
           self.mPlotItem = MultiPlotItem.MultiPlotItem()
  
verification_info: {"golden_diff": "diff --git a/pyqtgraph/graphicsItems/MultiPlotItem.py b/pyqtgraph/graphicsItems/MultiPlotItem.py\n--- a/pyqtgraph/graphicsItems/MultiPlotItem.py\n+++ b/pyqtgraph/graphicsItems/MultiPlotItem.py\n@@ -4,22 +4,33 @@\n Copyright 2010  Luke Campagnola\n Distributed under MIT/X11 license. See license.txt for more information.\n \"\"\"\n-from numpy import ndarray\n from . import GraphicsLayout\n from ..metaarray import *\n \n-\n __all__ = ['MultiPlotItem']\n+\n+\n class MultiPlotItem(GraphicsLayout.GraphicsLayout):\n     \"\"\"\n-    Automatically generates a grid of plots from a multi-dimensional array\n+    :class:`~pyqtgraph.GraphicsLayout` that automatically generates a grid of\n+    plots from a MetaArray.\n+\n+    .. seealso:: :class:`~pyqtgraph.MultiPlotWidget`: Widget containing a MultiPlotItem\n     \"\"\"\n+\n     def __init__(self, *args, **kwds):\n         GraphicsLayout.GraphicsLayout.__init__(self, *args, **kwds)\n         self.plots = []\n \n-\n     def plot(self, data, **plotArgs):\n+        \"\"\"Plot the data from a MetaArray with each array column as a separate\n+        :class:`~pyqtgraph.PlotItem`.\n+\n+        Axis labels are automatically extracted from the array info.\n+\n+        ``plotArgs`` are passed to :meth:`PlotItem.plot\n+        <pyqtgraph.PlotItem.plot>`.\n+        \"\"\"\n         #self.layout.clear()\n \n         if hasattr(data, 'implements') and data.implements('MetaArray'):\ndiff --git a/pyqtgraph/widgets/MultiPlotWidget.py b/pyqtgraph/widgets/MultiPlotWidget.py\n--- a/pyqtgraph/widgets/MultiPlotWidget.py\n+++ b/pyqtgraph/widgets/MultiPlotWidget.py\n@@ -10,7 +10,8 @@\n \n __all__ = ['MultiPlotWidget']\n class MultiPlotWidget(GraphicsView):\n-    \"\"\"Widget implementing a graphicsView with a single MultiPlotItem inside.\"\"\"\n+    \"\"\"Widget implementing a :class:`~pyqtgraph.GraphicsView` with a single\n+    :class:`~pyqtgraph.MultiPlotItem` inside.\"\"\"\n     def __init__(self, parent=None):\n         self.minPlotHeight = 50\n         self.mPlotItem = MultiPlotItem.MultiPlotItem()\n", "issue": "Add MultiPlotItem to docs\nI noticed it's missing in reviewing #1324. Also [MultiPlotWidget](https://pyqtgraph.readthedocs.io/en/latest/widgets/multiplotwidget.html) should link to it and indicate it wraps the item's methods. `MultiPlotItem.plot` could also use a docstring.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nMultiPlotWidget.py -  Convenience class--GraphicsView widget displaying a MultiPlotItem\nCopyright 2010  Luke Campagnola\nDistributed under MIT/X11 license. See license.txt for more information.\n\"\"\"\nfrom ..Qt import QtCore\nfrom .GraphicsView import GraphicsView\nfrom ..graphicsItems import MultiPlotItem as MultiPlotItem\n\n__all__ = ['MultiPlotWidget']\nclass MultiPlotWidget(GraphicsView):\n    \"\"\"Widget implementing a graphicsView with a single MultiPlotItem inside.\"\"\"\n    def __init__(self, parent=None):\n        self.minPlotHeight = 50\n        self.mPlotItem = MultiPlotItem.MultiPlotItem()\n        GraphicsView.__init__(self, parent)\n        self.enableMouse(False)\n        self.setCentralItem(self.mPlotItem)\n        ## Explicitly wrap methods from mPlotItem\n        #for m in ['setData']:\n            #setattr(self, m, getattr(self.mPlotItem, m))\n        self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)\n        self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)\n                \n    def __getattr__(self, attr):  ## implicitly wrap methods from plotItem\n        if hasattr(self.mPlotItem, attr):\n            m = getattr(self.mPlotItem, attr)\n            if hasattr(m, '__call__'):\n                return m\n        raise AttributeError(attr)\n\n    def setMinimumPlotHeight(self, min):\n        \"\"\"Set the minimum height for each sub-plot displayed. \n        \n        If the total height of all plots is greater than the height of the \n        widget, then a scroll bar will appear to provide access to the entire\n        set of plots.\n        \n        Added in version 0.9.9\n        \"\"\"\n        self.minPlotHeight = min\n        self.resizeEvent(None)\n\n    def widgetGroupInterface(self):\n        return (None, MultiPlotWidget.saveState, MultiPlotWidget.restoreState)\n\n    def saveState(self):\n        return {}\n        #return self.plotItem.saveState()\n        \n    def restoreState(self, state):\n        pass\n        #return self.plotItem.restoreState(state)\n\n    def close(self):\n        self.mPlotItem.close()\n        self.mPlotItem = None\n        self.setParent(None)\n        GraphicsView.close(self)\n\n    def setRange(self, *args, **kwds):\n        GraphicsView.setRange(self, *args, **kwds)\n        if self.centralWidget is not None:\n            r = self.range\n            minHeight = len(self.mPlotItem.plots) * self.minPlotHeight\n            if r.height() < minHeight:\n                r.setHeight(minHeight)\n                r.setWidth(r.width() - self.verticalScrollBar().width())\n            self.centralWidget.setGeometry(r)\n\n    def resizeEvent(self, ev):\n        if self.closed:\n            return\n        if self.autoPixelRange:\n            self.range = QtCore.QRectF(0, 0, self.size().width(), self.size().height())\n        MultiPlotWidget.setRange(self, self.range, padding=0, disableAutoPixel=False)  ## we do this because some subclasses like to redefine setRange in an incompatible way.\n        self.updateMatrix()\n", "path": "pyqtgraph/widgets/MultiPlotWidget.py"}, {"content": "# -*- coding: utf-8 -*-\n\"\"\"\nMultiPlotItem.py -  Graphics item used for displaying an array of PlotItems\nCopyright 2010  Luke Campagnola\nDistributed under MIT/X11 license. See license.txt for more information.\n\"\"\"\nfrom numpy import ndarray\nfrom . import GraphicsLayout\nfrom ..metaarray import *\n\n\n__all__ = ['MultiPlotItem']\nclass MultiPlotItem(GraphicsLayout.GraphicsLayout):\n    \"\"\"\n    Automatically generates a grid of plots from a multi-dimensional array\n    \"\"\"\n    def __init__(self, *args, **kwds):\n        GraphicsLayout.GraphicsLayout.__init__(self, *args, **kwds)\n        self.plots = []\n\n\n    def plot(self, data, **plotArgs):\n        #self.layout.clear()\n\n        if hasattr(data, 'implements') and data.implements('MetaArray'):\n            if data.ndim != 2:\n                raise Exception(\"MultiPlot currently only accepts 2D MetaArray.\")\n            ic = data.infoCopy()\n            ax = 0\n            for i in [0, 1]:\n                if 'cols' in ic[i]:\n                    ax = i\n                    break\n            #print \"Plotting using axis %d as columns (%d plots)\" % (ax, data.shape[ax])\n            for i in range(data.shape[ax]):\n                pi = self.addPlot()\n                self.nextRow()\n                sl = [slice(None)] * 2\n                sl[ax] = i\n                pi.plot(data[tuple(sl)], **plotArgs)\n                #self.layout.addItem(pi, i, 0)\n                self.plots.append((pi, i, 0))\n                info = ic[ax]['cols'][i]\n                title = info.get('title', info.get('name', None))\n                units = info.get('units', None)\n                pi.setLabel('left', text=title, units=units)\n            info = ic[1-ax]\n            title = info.get('title', info.get('name', None))\n            units = info.get('units', None)\n            pi.setLabel('bottom', text=title, units=units)\n        else:\n            raise Exception(\"Data type %s not (yet?) supported for MultiPlot.\" % type(data))\n\n    def close(self):\n        for p in self.plots:\n            p[0].close()\n        self.plots = None\n        self.clear()\n", "path": "pyqtgraph/graphicsItems/MultiPlotItem.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nMultiPlotWidget.py -  Convenience class--GraphicsView widget displaying a MultiPlotItem\nCopyright 2010  Luke Campagnola\nDistributed under MIT/X11 license. See license.txt for more information.\n\"\"\"\nfrom ..Qt import QtCore\nfrom .GraphicsView import GraphicsView\nfrom ..graphicsItems import MultiPlotItem as MultiPlotItem\n\n__all__ = ['MultiPlotWidget']\nclass MultiPlotWidget(GraphicsView):\n    \"\"\"Widget implementing a :class:`~pyqtgraph.GraphicsView` with a single\n    :class:`~pyqtgraph.MultiPlotItem` inside.\"\"\"\n    def __init__(self, parent=None):\n        self.minPlotHeight = 50\n        self.mPlotItem = MultiPlotItem.MultiPlotItem()\n        GraphicsView.__init__(self, parent)\n        self.enableMouse(False)\n        self.setCentralItem(self.mPlotItem)\n        ## Explicitly wrap methods from mPlotItem\n        #for m in ['setData']:\n            #setattr(self, m, getattr(self.mPlotItem, m))\n        self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)\n        self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)\n                \n    def __getattr__(self, attr):  ## implicitly wrap methods from plotItem\n        if hasattr(self.mPlotItem, attr):\n            m = getattr(self.mPlotItem, attr)\n            if hasattr(m, '__call__'):\n                return m\n        raise AttributeError(attr)\n\n    def setMinimumPlotHeight(self, min):\n        \"\"\"Set the minimum height for each sub-plot displayed. \n        \n        If the total height of all plots is greater than the height of the \n        widget, then a scroll bar will appear to provide access to the entire\n        set of plots.\n        \n        Added in version 0.9.9\n        \"\"\"\n        self.minPlotHeight = min\n        self.resizeEvent(None)\n\n    def widgetGroupInterface(self):\n        return (None, MultiPlotWidget.saveState, MultiPlotWidget.restoreState)\n\n    def saveState(self):\n        return {}\n        #return self.plotItem.saveState()\n        \n    def restoreState(self, state):\n        pass\n        #return self.plotItem.restoreState(state)\n\n    def close(self):\n        self.mPlotItem.close()\n        self.mPlotItem = None\n        self.setParent(None)\n        GraphicsView.close(self)\n\n    def setRange(self, *args, **kwds):\n        GraphicsView.setRange(self, *args, **kwds)\n        if self.centralWidget is not None:\n            r = self.range\n            minHeight = len(self.mPlotItem.plots) * self.minPlotHeight\n            if r.height() < minHeight:\n                r.setHeight(minHeight)\n                r.setWidth(r.width() - self.verticalScrollBar().width())\n            self.centralWidget.setGeometry(r)\n\n    def resizeEvent(self, ev):\n        if self.closed:\n            return\n        if self.autoPixelRange:\n            self.range = QtCore.QRectF(0, 0, self.size().width(), self.size().height())\n        MultiPlotWidget.setRange(self, self.range, padding=0, disableAutoPixel=False)  ## we do this because some subclasses like to redefine setRange in an incompatible way.\n        self.updateMatrix()\n", "path": "pyqtgraph/widgets/MultiPlotWidget.py"}, {"content": "# -*- coding: utf-8 -*-\n\"\"\"\nMultiPlotItem.py -  Graphics item used for displaying an array of PlotItems\nCopyright 2010  Luke Campagnola\nDistributed under MIT/X11 license. See license.txt for more information.\n\"\"\"\nfrom . import GraphicsLayout\nfrom ..metaarray import *\n\n__all__ = ['MultiPlotItem']\n\n\nclass MultiPlotItem(GraphicsLayout.GraphicsLayout):\n    \"\"\"\n    :class:`~pyqtgraph.GraphicsLayout` that automatically generates a grid of\n    plots from a MetaArray.\n\n    .. seealso:: :class:`~pyqtgraph.MultiPlotWidget`: Widget containing a MultiPlotItem\n    \"\"\"\n\n    def __init__(self, *args, **kwds):\n        GraphicsLayout.GraphicsLayout.__init__(self, *args, **kwds)\n        self.plots = []\n\n    def plot(self, data, **plotArgs):\n        \"\"\"Plot the data from a MetaArray with each array column as a separate\n        :class:`~pyqtgraph.PlotItem`.\n\n        Axis labels are automatically extracted from the array info.\n\n        ``plotArgs`` are passed to :meth:`PlotItem.plot\n        <pyqtgraph.PlotItem.plot>`.\n        \"\"\"\n        #self.layout.clear()\n\n        if hasattr(data, 'implements') and data.implements('MetaArray'):\n            if data.ndim != 2:\n                raise Exception(\"MultiPlot currently only accepts 2D MetaArray.\")\n            ic = data.infoCopy()\n            ax = 0\n            for i in [0, 1]:\n                if 'cols' in ic[i]:\n                    ax = i\n                    break\n            #print \"Plotting using axis %d as columns (%d plots)\" % (ax, data.shape[ax])\n            for i in range(data.shape[ax]):\n                pi = self.addPlot()\n                self.nextRow()\n                sl = [slice(None)] * 2\n                sl[ax] = i\n                pi.plot(data[tuple(sl)], **plotArgs)\n                #self.layout.addItem(pi, i, 0)\n                self.plots.append((pi, i, 0))\n                info = ic[ax]['cols'][i]\n                title = info.get('title', info.get('name', None))\n                units = info.get('units', None)\n                pi.setLabel('left', text=title, units=units)\n            info = ic[1-ax]\n            title = info.get('title', info.get('name', None))\n            units = info.get('units', None)\n            pi.setLabel('bottom', text=title, units=units)\n        else:\n            raise Exception(\"Data type %s not (yet?) supported for MultiPlot.\" % type(data))\n\n    def close(self):\n        for p in self.plots:\n            p[0].close()\n        self.plots = None\n        self.clear()\n", "path": "pyqtgraph/graphicsItems/MultiPlotItem.py"}]}