Update symbols documentation and inverted up and down arrows of scatterplotitem (#1747)
This commit is contained in:
parent
4d6a8e4998
commit
7dc4823cc6
|
@ -75,7 +75,7 @@ coords = {
|
||||||
(-0.1816, 0.059), (-0.2939, 0.4045), (0, 0.1910),
|
(-0.1816, 0.059), (-0.2939, 0.4045), (0, 0.1910),
|
||||||
(0.2939, 0.4045), (0.1816, 0.059), (0.4755, -0.1545),
|
(0.2939, 0.4045), (0.1816, 0.059), (0.4755, -0.1545),
|
||||||
(0.1123, -0.1545)],
|
(0.1123, -0.1545)],
|
||||||
'arrow_down': [
|
'arrow_up': [
|
||||||
(-0.125, 0.125), (0, 0), (0.125, 0.125),
|
(-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)
|
(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)
|
tr.rotate(45)
|
||||||
Symbols['x'] = tr.map(Symbols['+'])
|
Symbols['x'] = tr.map(Symbols['+'])
|
||||||
tr.rotate(45)
|
tr.rotate(45)
|
||||||
Symbols['arrow_right'] = tr.map(Symbols['arrow_down'])
|
Symbols['arrow_right'] = tr.map(Symbols['arrow_up'])
|
||||||
Symbols['arrow_up'] = tr.map(Symbols['arrow_right'])
|
Symbols['arrow_down'] = tr.map(Symbols['arrow_right'])
|
||||||
Symbols['arrow_left'] = tr.map(Symbols['arrow_up'])
|
Symbols['arrow_left'] = tr.map(Symbols['arrow_down'])
|
||||||
_DEFAULT_STYLE = {'symbol': None, 'size': -1, 'pen': None, 'brush': None, 'visible': True}
|
_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
|
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.
|
effective caching, QPen and QBrush objects should be reused as much as possible.
|
||||||
Default is True
|
Default is True
|
||||||
*symbol* can be one (or a list) of:
|
*symbol* can be one (or a list) of symbols. For a list of supported symbols, see
|
||||||
* 'o' circle (default)
|
:func:`~ScatterPlotItem.setSymbol`. QPainterPath is also supported to specify custom symbol
|
||||||
* 's' square
|
shapes. To properly obey the position and size, custom symbols should be centered at (0,0) and
|
||||||
* 't' triangle
|
width and height of 1.0. Note that it is also possible to 'install' custom shapes by setting
|
||||||
* 'd' diamond
|
ScatterPlotItem.Symbols[key] = shape.
|
||||||
* '+' 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.
|
|
||||||
*pen* The pen (or list of pens) to use for drawing spot outlines.
|
*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.
|
*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,
|
*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.
|
"""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.
|
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
|
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:
|
if dataSet is None:
|
||||||
dataSet = self.data
|
dataSet = self.data
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user