Merge pull request #1326 from ixjlyons/doc-multiplotitem

Improve docs for MultiPlotWidget and MultiPlotItem
This commit is contained in:
Kenneth Lyons 2020-08-01 17:19:18 -07:00 committed by GitHub
commit 7504f2ba27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 5 deletions

View File

@ -18,6 +18,7 @@ Contents:
infiniteline
roi
graphicslayout
multiplotitem
plotcurveitem
scatterplotitem
isocurveitem

View File

@ -0,0 +1,5 @@
MultiPlotItem
=============
.. autoclass:: pyqtgraph.MultiPlotItem
:members:

View File

@ -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
<pyqtgraph.PlotItem.plot>`.
"""
#self.layout.clear()
if hasattr(data, 'implements') and data.implements('MetaArray'):

View File

@ -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()