Merge pull request #1326 from ixjlyons/doc-multiplotitem
Improve docs for MultiPlotWidget and MultiPlotItem
This commit is contained in:
commit
7504f2ba27
@ -18,6 +18,7 @@ Contents:
|
|||||||
infiniteline
|
infiniteline
|
||||||
roi
|
roi
|
||||||
graphicslayout
|
graphicslayout
|
||||||
|
multiplotitem
|
||||||
plotcurveitem
|
plotcurveitem
|
||||||
scatterplotitem
|
scatterplotitem
|
||||||
isocurveitem
|
isocurveitem
|
||||||
|
5
doc/source/graphicsItems/multiplotitem.rst
Normal file
5
doc/source/graphicsItems/multiplotitem.rst
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
MultiPlotItem
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. autoclass:: pyqtgraph.MultiPlotItem
|
||||||
|
:members:
|
@ -4,22 +4,33 @@ MultiPlotItem.py - Graphics item used for displaying an array of PlotItems
|
|||||||
Copyright 2010 Luke Campagnola
|
Copyright 2010 Luke Campagnola
|
||||||
Distributed under MIT/X11 license. See license.txt for more information.
|
Distributed under MIT/X11 license. See license.txt for more information.
|
||||||
"""
|
"""
|
||||||
from numpy import ndarray
|
|
||||||
from . import GraphicsLayout
|
from . import GraphicsLayout
|
||||||
from ..metaarray import *
|
from ..metaarray import *
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['MultiPlotItem']
|
__all__ = ['MultiPlotItem']
|
||||||
|
|
||||||
|
|
||||||
class MultiPlotItem(GraphicsLayout.GraphicsLayout):
|
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):
|
def __init__(self, *args, **kwds):
|
||||||
GraphicsLayout.GraphicsLayout.__init__(self, *args, **kwds)
|
GraphicsLayout.GraphicsLayout.__init__(self, *args, **kwds)
|
||||||
self.plots = []
|
self.plots = []
|
||||||
|
|
||||||
|
|
||||||
def plot(self, data, **plotArgs):
|
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()
|
#self.layout.clear()
|
||||||
|
|
||||||
if hasattr(data, 'implements') and data.implements('MetaArray'):
|
if hasattr(data, 'implements') and data.implements('MetaArray'):
|
||||||
|
@ -10,7 +10,8 @@ from ..graphicsItems import MultiPlotItem as MultiPlotItem
|
|||||||
|
|
||||||
__all__ = ['MultiPlotWidget']
|
__all__ = ['MultiPlotWidget']
|
||||||
class MultiPlotWidget(GraphicsView):
|
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):
|
def __init__(self, parent=None):
|
||||||
self.minPlotHeight = 50
|
self.minPlotHeight = 50
|
||||||
self.mPlotItem = MultiPlotItem.MultiPlotItem()
|
self.mPlotItem = MultiPlotItem.MultiPlotItem()
|
||||||
|
Loading…
Reference in New Issue
Block a user