From 24116342c28c8528f1ec71da595668cb10f0b1f9 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Mon, 1 May 2017 09:43:16 -0700 Subject: [PATCH 1/2] Add option to set composition mode for scatterplotitem --- pyqtgraph/graphicsItems/ScatterPlotItem.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index 54667b50..9a23d965 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -251,6 +251,7 @@ class ScatterPlotItem(GraphicsObject): 'pxMode': True, 'useCache': True, ## If useCache is False, symbols are re-drawn on every paint. 'antialias': getConfigOption('antialias'), + 'compositionMode': None, 'name': None, } @@ -730,7 +731,9 @@ class ScatterPlotItem(GraphicsObject): @debug.warnOnException ## raising an exception here causes crash def paint(self, p, *args): - + cmode = self.opts.get('compositionMode', None) + if cmode is not None: + p.setCompositionMode(cmode) #p.setPen(fn.mkPen('r')) #p.drawRect(self.boundingRect()) From e0e087716828a63a2c0c4fff2a04e7e2ba860060 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Mon, 1 May 2017 10:22:27 -0700 Subject: [PATCH 2/2] Add documentation --- pyqtgraph/graphicsItems/ScatterPlotItem.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index 9a23d965..597491f3 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -300,6 +300,8 @@ class ScatterPlotItem(GraphicsObject): *antialias* Whether to draw symbols with antialiasing. Note that if pxMode is True, symbols are always rendered with antialiasing (since the rendered symbols can be cached, this incurs very little performance cost) + *compositionMode* If specified, this sets the composition mode used when drawing the + scatter plot (see QPainter::CompositionMode in the Qt documentation). *name* The name of this item. Names are used for automatically generating LegendItem entries and by some exporters. ====================== ===============================================================================================