Merge pull request #1324 from angulartist/feat/multiplotitem-plot-pen
Pass MultiPlotItem.plot kwargs through to child PlotDataItems
This commit is contained in:
commit
fe1a4d90f1
@ -30,7 +30,7 @@ ma = MetaArray(data, info=[
|
|||||||
]},
|
]},
|
||||||
{'name': 'Time', 'values': linspace(0., 1., 1000), 'units': 's'}
|
{'name': 'Time', 'values': linspace(0., 1., 1000), 'units': 's'}
|
||||||
])
|
])
|
||||||
pw.plot(ma)
|
pw.plot(ma, pen='y')
|
||||||
|
|
||||||
## Start Qt event loop unless running in interactive mode.
|
## Start Qt event loop unless running in interactive mode.
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -4,7 +4,6 @@ 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 numpy import ndarray
|
||||||
from . import GraphicsLayout
|
from . import GraphicsLayout
|
||||||
from ..metaarray import *
|
from ..metaarray import *
|
||||||
@ -20,7 +19,7 @@ class MultiPlotItem(GraphicsLayout.GraphicsLayout):
|
|||||||
self.plots = []
|
self.plots = []
|
||||||
|
|
||||||
|
|
||||||
def plot(self, data):
|
def plot(self, data, **plotArgs):
|
||||||
#self.layout.clear()
|
#self.layout.clear()
|
||||||
|
|
||||||
if hasattr(data, 'implements') and data.implements('MetaArray'):
|
if hasattr(data, 'implements') and data.implements('MetaArray'):
|
||||||
@ -38,7 +37,7 @@ class MultiPlotItem(GraphicsLayout.GraphicsLayout):
|
|||||||
self.nextRow()
|
self.nextRow()
|
||||||
sl = [slice(None)] * 2
|
sl = [slice(None)] * 2
|
||||||
sl[ax] = i
|
sl[ax] = i
|
||||||
pi.plot(data[tuple(sl)])
|
pi.plot(data[tuple(sl)], **plotArgs)
|
||||||
#self.layout.addItem(pi, i, 0)
|
#self.layout.addItem(pi, i, 0)
|
||||||
self.plots.append((pi, i, 0))
|
self.plots.append((pi, i, 0))
|
||||||
info = ic[ax]['cols'][i]
|
info = ic[ax]['cols'][i]
|
||||||
@ -57,6 +56,3 @@ class MultiPlotItem(GraphicsLayout.GraphicsLayout):
|
|||||||
p[0].close()
|
p[0].close()
|
||||||
self.plots = None
|
self.plots = None
|
||||||
self.clear()
|
self.clear()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user