items: Plot primitives

This package provides classes that describes Plot content.

Instances of those classes are returned by Plot methods that give access to its content such as Plot.getCurve(), Plot.getImage().

Curve

class silx.gui.plot.items.Curve

Description of a curve

setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise
getAlpha()

Returns the opacity of the item

Return type:float in [0, 1.]
getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColor()

Returns the RGBA color of the item

Return type:4-tuple of float in [0, 1]
getData(copy=True, displayed=False)

Returns the x, y values of the curve points and xerror, yerror

Parameters:
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
  • displayed (bool) – True to only get curve points that are displayed in the plot. Default: False Note: If plot has log scale, negative points are not displayed.
Returns:

(x, y, xerror, yerror)

Return type:

4-tuple of numpy.ndarray

getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getLineStyle()

Return the type of the line

Type of line:

- ' '  no line
- '-'  solid line
- '--' dashed line
- '-.' dash-dot line
- ':'  dotted line
Return type:str
getLineWidth()

Return the curve line width in pixels (int)

getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getSymbol()

Return the point marker type.

Marker type:

- 'o' circle
- '.' point
- ',' pixel
- '+' cross
- 'x' x-cross
- 'd' diamond
- 's' square
Return type:str
getSymbolSize()

Return the point marker size in points.

Return type:float
getXData(copy=True)

Returns the x coordinates of the data points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray
getXErrorData(copy=True)

Returns the x error of the points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray or None
getXLabel()

Return the X axis label associated to this curve

Return type:str or None
getYAxis()

Returns the Y axis this curve belongs to.

Either ‘left’ or ‘right’.

Return type:str
getYData(copy=True)

Returns the y coordinates of the data points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray
getYErrorData(copy=True)

Returns the y error of the points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray or None
getYLabel()

Return the Y axis label associated to this curve

Return type:str or None
getZValue()

Returns the layer on which to draw this item (int)

isFill()

Returns whether the item is filled or not.

Return type:bool
isHighlighted()

Returns True if curve is highlighted.

Return type:bool
isOverlay()

Return true if item is drawn as an overlay.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setAlpha(alpha)

Set the opacity of the item

Note

If the colormap already has some transparency, this alpha adds additional transparency. The alpha channel of the colormap is multiplied by this value.

Parameters:alpha (float) – Opacity of the item, between 0 (full transparency) and 1. (full opacity)
setColor(color, copy=True)

Set item color

Parameters:
  • color (str (“#RRGGBB”) or (npoints, 4) unsigned byte array or one of the predefined color names defined in Colors.py) – color(s) to be used
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
setData(x, y, xerror=None, yerror=None, copy=True)

Set the data of the curve.

Parameters:
  • x (numpy.ndarray) – The data corresponding to the x coordinates.
  • y (numpy.ndarray) – The data corresponding to the y coordinates.
  • xerror (A float, or a numpy.ndarray of float32. If it is an array, it can either be a 1D array of same length as the data or a 2D array with 2 rows of same length as the data: row 0 for positive errors, row 1 for negative errors.) – Values with the uncertainties on the x values
  • yerror (A float, or a numpy.ndarray of float32. See xerror.) – Values with the uncertainties on the y values.
  • copy (bool) – True make a copy of the data (default), False to use provided arrays.
setFill(fill)

Set whether to fill the item or not.

Parameters:fill (bool) –
setLineStyle(style)

Set the style of the curve line.

See getLineStyle().

Parameters:style (str) – Line style
setLineWidth(width)

Set the width in pixel of the curve line

See getLineWidth().

Parameters:width (float) – Width in pixels
setSymbol(symbol)

Set the marker type

See getSymbol().

Parameters:symbol (str) – Marker type
setSymbolSize(size)

Set the point marker size in points.

See getSymbolSize().

Parameters:symbol (str) – Marker type
setYAxis(yaxis)

Set the Y axis this curve belongs to.

Parameters:yaxis (str) – ‘left’ or ‘right’
setHighlighted(highlighted)

Set the highlight state of the curve

Parameters:highlighted (bool) –
getHighlightedColor()

Returns the RGBA highlight color of the item

Return type:4-tuple of int in [0, 255]
setHighlightedColor(color)

Set the color to use when highlighted

Parameters:color (str (“#RRGGBB”) or (npoints, 4) unsigned byte array or one of the predefined color names defined in Colors.py) – color(s) to be used for highlight
getCurrentColor()

Returns the current color of the curve.

This color is either the color of the curve or the highlighted color, depending on the highlight state.

Return type:4-tuple of int in [0, 255]

Images

class silx.gui.plot.items.ImageData

Description of a data image with a colormap

getRgbaImageData(copy=True)

Get the displayed RGB(A) image

Returns:numpy.ndarray of uint8 of shape (height, width, 4)
getAlternativeImageData(copy=True)

Get the optional RGBA image that is displayed instead of the data

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Returns:None or numpy.ndarray
Return type:numpy.ndarray or None
setData(data, alternative=None, copy=True)

“Set the image data and optionally an alternative RGB(A) representation

Parameters:
  • data (numpy.ndarray) – Data array with 2 dimensions (h, w)
  • alternative (None or numpy.ndarray) – RGB(A) image to display instead of data, shape: (h, w, 3 or 4)
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
getAlpha()

Returns the opacity of the item

Return type:float in [0, 1.]
getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColormap()

Return the used colormap

getData(copy=True)

Returns the image data

Parameters:copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray
getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getOrigin()

Returns the offset from origin at which to display the image.

Return type:2-tuple of float
getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getScale()

Returns the scale of the image in data coordinates.

Return type:2-tuple of float
getXLabel()

Return the X axis label associated to this curve

Return type:str or None
getYLabel()

Return the Y axis label associated to this curve

Return type:str or None
getZValue()

Returns the layer on which to draw this item (int)

isDraggable()

Returns true if image is draggable

Return type:bool
isOverlay()

Return true if item is drawn as an overlay.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setAlpha(alpha)

Set the opacity of the item

Note

If the colormap already has some transparency, this alpha adds additional transparency. The alpha channel of the colormap is multiplied by this value.

Parameters:alpha (float) – Opacity of the item, between 0 (full transparency) and 1. (full opacity)
setColormap(colormap)

Set the colormap of this image

Parameters:colormap (dict) – colormap description
setOrigin(origin)

Set the offset from origin at which to display the image.

Parameters:origin (float or 2-tuple of float) – (ox, oy) Offset from origin
setScale(scale)

Set the scale of the image

Parameters:scale (float or 2-tuple of float) – (sx, sy) Scale of the image
setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise
class silx.gui.plot.items.ImageRgba

Description of an RGB(A) image

getRgbaImageData(copy=True)

Get the displayed RGB(A) image

Returns:numpy.ndarray of uint8 of shape (height, width, 4)
setData(data, copy=True)

Set the image data

Parameters:
  • data – RGB(A) image data to set
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
getAlpha()

Returns the opacity of the item

Return type:float in [0, 1.]
getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getData(copy=True)

Returns the image data

Parameters:copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray
getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getOrigin()

Returns the offset from origin at which to display the image.

Return type:2-tuple of float
getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getScale()

Returns the scale of the image in data coordinates.

Return type:2-tuple of float
getXLabel()

Return the X axis label associated to this curve

Return type:str or None
getYLabel()

Return the Y axis label associated to this curve

Return type:str or None
getZValue()

Returns the layer on which to draw this item (int)

isDraggable()

Returns true if image is draggable

Return type:bool
isOverlay()

Return true if item is drawn as an overlay.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setAlpha(alpha)

Set the opacity of the item

Note

If the colormap already has some transparency, this alpha adds additional transparency. The alpha channel of the colormap is multiplied by this value.

Parameters:alpha (float) – Opacity of the item, between 0 (full transparency) and 1. (full opacity)
setOrigin(origin)

Set the offset from origin at which to display the image.

Parameters:origin (float or 2-tuple of float) – (ox, oy) Offset from origin
setScale(scale)

Set the scale of the image

Parameters:scale (float or 2-tuple of float) – (sx, sy) Scale of the image
setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise

Scatter

class silx.gui.plot.items.Scatter

Description of a scatter

getValueData(copy=True)

Returns the value assigned to the scatter data points.

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray
getData(copy=True, displayed=False)

Returns the x, y coordinates and the value of the data points

Parameters:
  • copy – True (Default) to get a copy, False to use internal representation (do not modify!)
  • displayed (bool) – True to only get curve points that are displayed in the plot. Default: False. Note: If plot has log scale, negative points are not displayed.
Returns:

(x, y, value, xerror, yerror)

Return type:

5-tuple of numpy.ndarray

getAlpha()

Returns the opacity of the item

Return type:float in [0, 1.]
getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColormap()

Return the used colormap

getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getSymbol()

Return the point marker type.

Marker type:

- 'o' circle
- '.' point
- ',' pixel
- '+' cross
- 'x' x-cross
- 'd' diamond
- 's' square
Return type:str
getSymbolSize()

Return the point marker size in points.

Return type:float
getXData(copy=True)

Returns the x coordinates of the data points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray
getXErrorData(copy=True)

Returns the x error of the points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray or None
getYData(copy=True)

Returns the y coordinates of the data points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray
getYErrorData(copy=True)

Returns the y error of the points

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Return type:numpy.ndarray or None
getZValue()

Returns the layer on which to draw this item (int)

isOverlay()

Return true if item is drawn as an overlay.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setAlpha(alpha)

Set the opacity of the item

Note

If the colormap already has some transparency, this alpha adds additional transparency. The alpha channel of the colormap is multiplied by this value.

Parameters:alpha (float) – Opacity of the item, between 0 (full transparency) and 1. (full opacity)
setColormap(colormap)

Set the colormap of this image

Parameters:colormap (dict) – colormap description
setData(x, y, value, xerror=None, yerror=None, copy=True)

Set the data of the scatter.

Parameters:
  • x (numpy.ndarray) – The data corresponding to the x coordinates.
  • y (numpy.ndarray) – The data corresponding to the y coordinates.
  • value (numpy.ndarray) – The data corresponding to the value of the data points.
  • xerror (A float, or a numpy.ndarray of float32. If it is an array, it can either be a 1D array of same length as the data or a 2D array with 2 rows of same length as the data: row 0 for positive errors, row 1 for negative errors.) – Values with the uncertainties on the x values
  • yerror (A float, or a numpy.ndarray of float32. See xerror.) – Values with the uncertainties on the y values
  • copy (bool) – True make a copy of the data (default), False to use provided arrays.
setSymbol(symbol)

Set the marker type

See getSymbol().

Parameters:symbol (str) – Marker type
setSymbolSize(size)

Set the point marker size in points.

See getSymbolSize().

Parameters:symbol (str) – Marker type
setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise

Histogram

class silx.gui.plot.items.Histogram

Description of an histogram

setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise
getAlpha()

Returns the opacity of the item

Return type:float in [0, 1.]
getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColor()

Returns the RGBA color of the item

Return type:4-tuple of float in [0, 1]
getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getLineStyle()

Return the type of the line

Type of line:

- ' '  no line
- '-'  solid line
- '--' dashed line
- '-.' dash-dot line
- ':'  dotted line
Return type:str
getLineWidth()

Return the curve line width in pixels (int)

getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getValueData(copy=True)

The values of the histogram

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Returns:The bin edges of the histogram
Return type:numpy.ndarray
getYAxis()

Returns the Y axis this curve belongs to.

Either ‘left’ or ‘right’.

Return type:str
getZValue()

Returns the layer on which to draw this item (int)

isFill()

Returns whether the item is filled or not.

Return type:bool
isOverlay()

Return true if item is drawn as an overlay.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setAlpha(alpha)

Set the opacity of the item

Note

If the colormap already has some transparency, this alpha adds additional transparency. The alpha channel of the colormap is multiplied by this value.

Parameters:alpha (float) – Opacity of the item, between 0 (full transparency) and 1. (full opacity)
setColor(color, copy=True)

Set item color

Parameters:
  • color (str (“#RRGGBB”) or (npoints, 4) unsigned byte array or one of the predefined color names defined in Colors.py) – color(s) to be used
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
setFill(fill)

Set whether to fill the item or not.

Parameters:fill (bool) –
setLineStyle(style)

Set the style of the curve line.

See getLineStyle().

Parameters:style (str) – Line style
setLineWidth(width)

Set the width in pixel of the curve line

See getLineWidth().

Parameters:width (float) – Width in pixels
setYAxis(yaxis)

Set the Y axis this curve belongs to.

Parameters:yaxis (str) – ‘left’ or ‘right’
getBinEdgesData(copy=True)

The bin edges of the histogram (number of histogram values + 1)

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Returns:The bin edges of the histogram
Return type:numpy.ndarray
getData(copy=True)

Return the histogram values and the bin edges

Parameters:copy – True (Default) to get a copy, False to use internal representation (do not modify!)
Returns:(N histogram value, N+1 bin edges)
Return type:2-tuple of numpy.nadarray
setData(histogram, edges, align='center', copy=True)

Set the histogram values and bin edges.

Parameters:
  • histogram (numpy.ndarray) – The values of the histogram.
  • edges (numpy.ndarray) – The bin edges of the histogram. If histogram and edges have the same length, the bin edges are computed according to the align parameter.
  • align (str) – In case histogram values and edges have the same length N, the N+1 bin edges are computed according to the alignment in: ‘center’ (default), ‘left’, ‘right’.
  • copy (bool) – True make a copy of the data (default), False to use provided arrays.

Markers

class silx.gui.plot.items.Marker

Description of a marker

getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColor()

Returns the RGBA color of the item

Return type:4-tuple of float in [0, 1]
getConstraint()

Returns the dragging constraint of this item

getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getPosition()

Returns the (x, y) position of the marker in data coordinates

Return type:2-tuple of float or None
getSymbol()

Return the point marker type.

Marker type:

- 'o' circle
- '.' point
- ',' pixel
- '+' cross
- 'x' x-cross
- 'd' diamond
- 's' square
Return type:str
getSymbolSize()

Return the point marker size in points.

Return type:float
getText()

Returns marker text.

Return type:str
getXPosition()

Returns the X position of the marker line in data coordinates

Return type:float or None
getYPosition()

Returns the Y position of the marker line in data coordinates

Return type:float or None
getZValue()

Returns the layer on which to draw this item (int)

isDraggable()

Returns true if image is draggable

Return type:bool
isOverlay()

Return true if marker is drawn as an overlay.

A marker is an overlay if it is draggable.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setColor(color, copy=True)

Set item color

Parameters:
  • color (str (“#RRGGBB”) or (npoints, 4) unsigned byte array or one of the predefined color names defined in Colors.py) – color(s) to be used
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
setPosition(x, y)

Set marker position in data coordinates

Constraint are applied if any.

Parameters:
  • x (float) – X coordinates in data frame
  • y (float) – Y coordinates in data frame
setSymbol(symbol)

Set the marker type

See getSymbol().

Parameters:symbol (str) – Marker type
setSymbolSize(size)

Set the point marker size in points.

See getSymbolSize().

Parameters:symbol (str) – Marker type
setText(text)

Set the text of the marker.

Parameters:text (str) – The text to use
setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise
class silx.gui.plot.items.XMarker

Description of a marker

setPosition(x, y)

Set marker line position in data coordinates

Constraint are applied if any.

Parameters:
  • x (float) – X coordinates in data frame
  • y (float) – Y coordinates in data frame
getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColor()

Returns the RGBA color of the item

Return type:4-tuple of float in [0, 1]
getConstraint()

Returns the dragging constraint of this item

getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getPosition()

Returns the (x, y) position of the marker in data coordinates

Return type:2-tuple of float or None
getText()

Returns marker text.

Return type:str
getXPosition()

Returns the X position of the marker line in data coordinates

Return type:float or None
getYPosition()

Returns the Y position of the marker line in data coordinates

Return type:float or None
getZValue()

Returns the layer on which to draw this item (int)

isDraggable()

Returns true if image is draggable

Return type:bool
isOverlay()

Return true if marker is drawn as an overlay.

A marker is an overlay if it is draggable.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setColor(color, copy=True)

Set item color

Parameters:
  • color (str (“#RRGGBB”) or (npoints, 4) unsigned byte array or one of the predefined color names defined in Colors.py) – color(s) to be used
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
setText(text)

Set the text of the marker.

Parameters:text (str) – The text to use
setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise
class silx.gui.plot.items.YMarker

Description of a marker

getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColor()

Returns the RGBA color of the item

Return type:4-tuple of float in [0, 1]
getConstraint()

Returns the dragging constraint of this item

getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getPosition()

Returns the (x, y) position of the marker in data coordinates

Return type:2-tuple of float or None
getText()

Returns marker text.

Return type:str
getXPosition()

Returns the X position of the marker line in data coordinates

Return type:float or None
getYPosition()

Returns the Y position of the marker line in data coordinates

Return type:float or None
getZValue()

Returns the layer on which to draw this item (int)

isDraggable()

Returns true if image is draggable

Return type:bool
isOverlay()

Return true if marker is drawn as an overlay.

A marker is an overlay if it is draggable.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setColor(color, copy=True)

Set item color

Parameters:
  • color (str (“#RRGGBB”) or (npoints, 4) unsigned byte array or one of the predefined color names defined in Colors.py) – color(s) to be used
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
setText(text)

Set the text of the marker.

Parameters:text (str) – The text to use
setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise
setPosition(x, y)

Set marker line position in data coordinates

Constraint are applied if any.

Parameters:
  • x (float) – X coordinates in data frame
  • y (float) – Y coordinates in data frame

Item

class silx.gui.plot.items.Shape(type_)

Description of a shape item

Parameters:type (str) – The type of shape in: ‘hline’, ‘polygon’, ‘rectangle’, ‘vline’, ‘polyline’
isOverlay()

Return true if shape is drawn as an overlay

Return type:bool
setOverlay(overlay)

Set the overlay state of the shape

Parameters:overlay (bool) – True to make it an overlay
getType()

Returns the type of shape to draw.

One of: ‘hline’, ‘polygon’, ‘rectangle’, ‘vline’, ‘polyline’

Return type:str
getPoints(copy=True)

Get the control points of the shape.

Parameters:copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
Returns:Array of point coordinates
Return type:numpy.ndarray with 2 dimensions
setPoints(points, copy=True)

Set the point coordinates

Parameters:
  • points (numpy.ndarray) – Array of point coordinates
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
Returns:

getBounds()

Returns the bounding box of this item in data coordinates

Returns:(xmin, xmax, ymin, ymax) or None
Return type:4-tuple of float or None
getColor()

Returns the RGBA color of the item

Return type:4-tuple of float in [0, 1]
getInfo(copy=True)

Returns the info associated to this item

Parameters:copy (bool) – True to get a deepcopy, False otherwise.
getLegend()

Returns the legend of this item (str)

getPlot()

Returns Plot this item belongs to.

Return type:Plot or None
getZValue()

Returns the layer on which to draw this item (int)

isFill()

Returns whether the item is filled or not.

Return type:bool
isSelectable()

Returns true if item is selectable (bool)

isVisible()

True if item is visible, False otherwise

Return type:bool
setColor(color, copy=True)

Set item color

Parameters:
  • color (str (“#RRGGBB”) or (npoints, 4) unsigned byte array or one of the predefined color names defined in Colors.py) – color(s) to be used
  • copy (bool) – True (Default) to get a copy, False to use internal representation (do not modify!)
setFill(fill)

Set whether to fill the item or not.

Parameters:fill (bool) –
setVisible(visible)

Set visibility of item.

Parameters:visible (bool) – True to display it, False otherwise

Table Of Contents

Previous topic

Plot: Full plot API

Next topic

PlotActions: Actions for PlotWidget

This Page