From 7dc4823cc69b9ec9b76feb5f2efe41f4f369bd27 Mon Sep 17 00:00:00 2001 From: Fernando Bordignon Date: Thu, 29 Apr 2021 23:34:19 -0300 Subject: [PATCH] Update symbols documentation and inverted up and down arrows of scatterplotitem (#1747) --- pyqtgraph/graphicsItems/ScatterPlotItem.py | 47 +++++++++++++++------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/pyqtgraph/graphicsItems/ScatterPlotItem.py b/pyqtgraph/graphicsItems/ScatterPlotItem.py index 080a8b24..59117d2c 100644 --- a/pyqtgraph/graphicsItems/ScatterPlotItem.py +++ b/pyqtgraph/graphicsItems/ScatterPlotItem.py @@ -75,7 +75,7 @@ coords = { (-0.1816, 0.059), (-0.2939, 0.4045), (0, 0.1910), (0.2939, 0.4045), (0.1816, 0.059), (0.4755, -0.1545), (0.1123, -0.1545)], - 'arrow_down': [ + 'arrow_up': [ (-0.125, 0.125), (0, 0), (0.125, 0.125), (0.05, 0.125), (0.05, 0.5), (-0.05, 0.5), (-0.05, 0.125) ] @@ -89,9 +89,9 @@ tr = QtGui.QTransform() tr.rotate(45) Symbols['x'] = tr.map(Symbols['+']) tr.rotate(45) -Symbols['arrow_right'] = tr.map(Symbols['arrow_down']) -Symbols['arrow_up'] = tr.map(Symbols['arrow_right']) -Symbols['arrow_left'] = tr.map(Symbols['arrow_up']) +Symbols['arrow_right'] = tr.map(Symbols['arrow_up']) +Symbols['arrow_down'] = tr.map(Symbols['arrow_right']) +Symbols['arrow_left'] = tr.map(Symbols['arrow_down']) _DEFAULT_STYLE = {'symbol': None, 'size': -1, 'pen': None, 'brush': None, 'visible': True} @@ -454,15 +454,11 @@ class ScatterPlotItem(GraphicsObject): Otherwise, size is in scene coordinates and the spots scale with the view. To ensure effective caching, QPen and QBrush objects should be reused as much as possible. Default is True - *symbol* can be one (or a list) of: - * 'o' circle (default) - * 's' square - * 't' triangle - * 'd' diamond - * '+' plus - * any QPainterPath to specify custom symbol shapes. To properly obey the position and size, - custom symbols should be centered at (0,0) and width and height of 1.0. Note that it is also - possible to 'install' custom shapes by setting ScatterPlotItem.Symbols[key] = shape. + *symbol* can be one (or a list) of symbols. For a list of supported symbols, see + :func:`~ScatterPlotItem.setSymbol`. QPainterPath is also supported to specify custom symbol + shapes. To properly obey the position and size, custom symbols should be centered at (0,0) and + width and height of 1.0. Note that it is also possible to 'install' custom shapes by setting + ScatterPlotItem.Symbols[key] = shape. *pen* The pen (or list of pens) to use for drawing spot outlines. *brush* The brush (or list of brushes) to use for filling spots. *size* The size (or list of sizes) of spots. If *pxMode* is True, this value is in pixels. Otherwise, @@ -691,7 +687,30 @@ class ScatterPlotItem(GraphicsObject): """Set the symbol(s) used to draw each spot. If a list or array is provided, then the symbol for each spot will be set separately. Otherwise, the argument will be used as the default symbol for - all spots which do not have a symbol explicitly set.""" + all spots which do not have a symbol explicitly set. + + **Supported symbols:** + + * 'o' circle (default) + * 's' square + * 't' triangle + * 'd' diamond + * '+' plus + * 't1' triangle pointing upwards + * 't2' triangle pointing right side + * 't3' triangle pointing left side + * 'p' pentagon + * 'h' hexagon + * 'star' + * 'x' cross + * 'arrow_up' + * 'arrow_right' + * 'arrow_down' + * 'arrow_left' + * 'crosshair' + * any QPainterPath to specify custom symbol shapes. + + """ if dataSet is None: dataSet = self.data