Update symbols documentation and inverted up and down arrows of scatterplotitem (#1747)

This commit is contained in:
Fernando Bordignon 2021-04-29 23:34:19 -03:00 committed by GitHub
parent 4d6a8e4998
commit 7dc4823cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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