diff --git a/doc/source/graphicsItems/index.rst b/doc/source/graphicsItems/index.rst index 390d8f17..8eb44062 100644 --- a/doc/source/graphicsItems/index.rst +++ b/doc/source/graphicsItems/index.rst @@ -18,6 +18,7 @@ Contents: infiniteline roi graphicslayout + multiplotitem plotcurveitem scatterplotitem isocurveitem diff --git a/doc/source/graphicsItems/multiplotitem.rst b/doc/source/graphicsItems/multiplotitem.rst new file mode 100644 index 00000000..cfcd1bf2 --- /dev/null +++ b/doc/source/graphicsItems/multiplotitem.rst @@ -0,0 +1,5 @@ +MultiPlotItem +============= + +.. autoclass:: pyqtgraph.MultiPlotItem + :members: diff --git a/pyqtgraph/graphicsItems/MultiPlotItem.py b/pyqtgraph/graphicsItems/MultiPlotItem.py index 588de331..fb045afe 100644 --- a/pyqtgraph/graphicsItems/MultiPlotItem.py +++ b/pyqtgraph/graphicsItems/MultiPlotItem.py @@ -4,22 +4,33 @@ MultiPlotItem.py - Graphics item used for displaying an array of PlotItems 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 + `. + """ #self.layout.clear() if hasattr(data, 'implements') and data.implements('MetaArray'): diff --git a/pyqtgraph/widgets/MultiPlotWidget.py b/pyqtgraph/widgets/MultiPlotWidget.py index 21258839..dc7583b6 100644 --- a/pyqtgraph/widgets/MultiPlotWidget.py +++ b/pyqtgraph/widgets/MultiPlotWidget.py @@ -10,7 +10,8 @@ from ..graphicsItems import MultiPlotItem as MultiPlotItem __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()