This package provides classes that describes PlotWidget content.
Instances of those classes are returned by PlotWidget methods that give access to its content such as PlotWidget.getCurve(), PlotWidget.getImage().
All plot primitives inherits from Item as a common ground:
Bases: PyQt4.QtCore.QObject
Description of an item of the plot
Signal emitted when the item has changed.
It provides a flag describing which property of the item has changed. See ItemChangedType for flags description.
Returns Plot this item belongs to.
Return type: | Plot or None |
---|
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 |
True if item is visible, False otherwise
Return type: | bool |
---|
Set visibility of item.
Parameters: | visible (bool) – True to display it, False otherwise |
---|
Return true if item is drawn as an overlay.
Return type: | bool |
---|
Returns the legend of this item (str)
Returns true if item is selectable (bool)
Returns the layer on which to draw this item (int)
Returns the info associated to this item
Parameters: | copy (bool) – True to get a deepcopy, False otherwise. |
---|
Description of a curve
Returns the opacity of the item
Return type: | float in [0, 1.] |
---|
Returns the RGBA color of the item
Return type: | 4-tuple of float in [0, 1] or array of colors |
---|
Returns the x, y values of the curve points and xerror, yerror
Parameters: |
|
---|---|
Returns: | (x, y, xerror, yerror) |
Return type: | 4-tuple of numpy.ndarray |
Return the type of the line
Type of line:
- ' ' no line
- '-' solid line
- '--' dashed line
- '-.' dash-dot line
- ':' dotted line
Return type: | str |
---|
Return the curve line width in pixels (int)
Return the point marker type.
Marker type:
- 'o' circle
- '.' point
- ',' pixel
- '+' cross
- 'x' x-cross
- 'd' diamond
- 's' square
Return type: | str |
---|
Return the point marker size in points.
Return type: | float |
---|
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 |
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, float or None |
Return the X axis label associated to this curve
Return type: | str or None |
---|
Returns the Y axis this curve belongs to.
Either ‘left’ or ‘right’.
Return type: | str |
---|
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 |
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, float or None |
Return the Y axis label associated to this curve
Return type: | str or None |
---|
Returns whether the item is filled or not.
Return type: | bool |
---|
Returns True if curve is highlighted.
Return type: | bool |
---|
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) |
---|
Set item color
Parameters: |
|
---|
Set the data of the curve.
Parameters: |
|
---|
Set whether to fill the item or not.
Parameters: | fill (bool) – |
---|
Set the style of the curve line.
See getLineStyle().
Parameters: | style (str) – Line style |
---|
Set the width in pixel of the curve line
See getLineWidth().
Parameters: | width (float) – Width in pixels |
---|
Set the marker type
See getSymbol().
Parameters: | symbol (str) – Marker type |
---|
Set the point marker size in points.
See getSymbolSize().
Parameters: | symbol (str) – Marker type |
---|
Set the Y axis this curve belongs to.
Parameters: | yaxis (str) – ‘left’ or ‘right’ |
---|
Set the highlight state of the curve
Parameters: | highlighted (bool) – |
---|
Returns the RGBA highlight color of the item
Return type: | 4-tuple of int in [0, 255] |
---|
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 |
---|
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] |
---|
Description of a data image with a colormap
Get the displayed RGB(A) image
Returns: | numpy.ndarray of uint8 of shape (height, width, 4) |
---|
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 |
Returns the opacity of the item
Return type: | float in [0, 1.] |
---|
Return the used colormap
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 |
Returns the offset from origin at which to display the image.
Return type: | 2-tuple of float |
---|
Returns the scale of the image in data coordinates.
Return type: | 2-tuple of float |
---|
Returns true if image is draggable
Return type: | bool |
---|
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) |
---|
Set the colormap of this image
Parameters: | colormap (Colormap) – colormap description |
---|
Set the offset from origin at which to display the image.
Parameters: | origin (float or 2-tuple of float) – (ox, oy) Offset from origin |
---|
Set the scale of the image
Parameters: | scale (float or 2-tuple of float) – (sx, sy) Scale of the image |
---|
Description of an RGB(A) image
Get the displayed RGB(A) image
Returns: | numpy.ndarray of uint8 of shape (height, width, 4) |
---|
Returns the opacity of the item
Return type: | float in [0, 1.] |
---|
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 |
Returns the offset from origin at which to display the image.
Return type: | 2-tuple of float |
---|
Returns the scale of the image in data coordinates.
Return type: | 2-tuple of float |
---|
Returns true if image is draggable
Return type: | bool |
---|
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) |
---|
Set the offset from origin at which to display the image.
Parameters: | origin (float or 2-tuple of float) – (ox, oy) Offset from origin |
---|
Set the scale of the image
Parameters: | scale (float or 2-tuple of float) – (sx, sy) Scale of the image |
---|
Description of a scatter
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 |
Returns the x, y coordinates and the value of the data points
Parameters: |
|
---|---|
Returns: | (x, y, value, xerror, yerror) |
Return type: | 5-tuple of numpy.ndarray |
Returns the opacity of the item
Return type: | float in [0, 1.] |
---|
Return the used colormap
Return the point marker type.
Marker type:
- 'o' circle
- '.' point
- ',' pixel
- '+' cross
- 'x' x-cross
- 'd' diamond
- 's' square
Return type: | str |
---|
Return the point marker size in points.
Return type: | float |
---|
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 |
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, float or None |
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 |
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, float or None |
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) |
---|
Set the colormap of this image
Parameters: | colormap (Colormap) – colormap description |
---|
Set the data of the scatter.
Parameters: |
|
---|
Set the marker type
See getSymbol().
Parameters: | symbol (str) – Marker type |
---|
Set the point marker size in points.
See getSymbolSize().
Parameters: | symbol (str) – Marker type |
---|
Description of an histogram
Returns the opacity of the item
Return type: | float in [0, 1.] |
---|
Returns the RGBA color of the item
Return type: | 4-tuple of float in [0, 1] or array of colors |
---|
Return the type of the line
Type of line:
- ' ' no line
- '-' solid line
- '--' dashed line
- '-.' dash-dot line
- ':' dotted line
Return type: | str |
---|
Return the curve line width in pixels (int)
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 |
Returns the Y axis this curve belongs to.
Either ‘left’ or ‘right’.
Return type: | str |
---|
Returns whether the item is filled or not.
Return type: | bool |
---|
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) |
---|
Set item color
Parameters: |
|
---|
Set whether to fill the item or not.
Parameters: | fill (bool) – |
---|
Set the style of the curve line.
See getLineStyle().
Parameters: | style (str) – Line style |
---|
Set the width in pixel of the curve line
See getLineWidth().
Parameters: | width (float) – Width in pixels |
---|
Set the Y axis this curve belongs to.
Parameters: | yaxis (str) – ‘left’ or ‘right’ |
---|
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 |
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 |
Set the histogram values and bin edges.
Parameters: |
|
---|
Description of a marker
Returns the dragging constraint of this item
Returns the (x, y) position of the marker in data coordinates
Return type: | 2-tuple of float or None |
---|
Return the point marker type.
Marker type:
- 'o' circle
- '.' point
- ',' pixel
- '+' cross
- 'x' x-cross
- 'd' diamond
- 's' square
Return type: | str |
---|
Return the point marker size in points.
Return type: | float |
---|
Returns marker text.
Return type: | str |
---|
Returns the X position of the marker line in data coordinates
Return type: | float or None |
---|
Returns the Y position of the marker line in data coordinates
Return type: | float or None |
---|
Set marker position in data coordinates
Constraint are applied if any.
Parameters: |
|
---|
Set the marker type
See getSymbol().
Parameters: | symbol (str) – Marker type |
---|
Set the point marker size in points.
See getSymbolSize().
Parameters: | symbol (str) – Marker type |
---|
Set the text of the marker.
Parameters: | text (str) – The text to use |
---|
Description of a marker
Set marker line position in data coordinates
Constraint are applied if any.
Parameters: |
|
---|
Returns the dragging constraint of this item
Returns the (x, y) position of the marker in data coordinates
Return type: | 2-tuple of float or None |
---|
Returns marker text.
Return type: | str |
---|
Returns the X position of the marker line in data coordinates
Return type: | float or None |
---|
Returns the Y position of the marker line in data coordinates
Return type: | float or None |
---|
Set the text of the marker.
Parameters: | text (str) – The text to use |
---|
Description of a marker
Returns the dragging constraint of this item
Returns the (x, y) position of the marker in data coordinates
Return type: | 2-tuple of float or None |
---|
Returns marker text.
Return type: | str |
---|
Returns the X position of the marker line in data coordinates
Return type: | float or None |
---|
Returns the Y position of the marker line in data coordinates
Return type: | float or None |
---|
Set the text of the marker.
Parameters: | text (str) – The text to use |
---|
Set marker line position in data coordinates
Constraint are applied if any.
Parameters: |
|
---|
Description of a shape item
Parameters: | type (str) – The type of shape in: ‘hline’, ‘polygon’, ‘rectangle’, ‘vline’, ‘polylines’ |
---|
Set the overlay state of the shape
Parameters: | overlay (bool) – True to make it an overlay |
---|
Returns the type of shape to draw.
One of: ‘hline’, ‘polygon’, ‘rectangle’, ‘vline’, ‘polylines’
Return type: | str |
---|
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 |
Set the point coordinates
Parameters: |
|
---|---|
Returns: |
Returns the RGBA color of the item
Return type: | 4-tuple of float in [0, 1] or array of colors |
---|
Returns whether the item is filled or not.
Return type: | bool |
---|
Set item color
Parameters: |
|
---|
Set whether to fill the item or not.
Parameters: | fill (bool) – |
---|
Plot items emit a Item.sigItemChanged signal when their values are updated. This signal provides a flag in the following enumeration describing the modified value:
Type of modification provided by Item.sigItemChanged signal.
Item’s visibility changed flag.
Item’s Z value changed flag.
Item’s colormap changed flag.
This is emitted both when setting a new colormap and when the current colormap object is updated.
Item’s symbol changed flag.
Item’s symbol size changed flag.
Item’s line width changed flag.
Item’s line style changed flag.
Item’s color changed flag.
Item’s Y axis binding changed flag.
Item’s fill changed flag.
Item’s transparency alpha changed flag.
Item’s data changed flag
Item’s highlight state changed flag.
Item’s highlighted color changed flag.
Item’s scale changed flag.
Item’s text changed flag.
Item’s position changed flag.
This is emitted when a marker position changed and when an image origin changed.
Item’s overlay state changed flag.
This class describes and controls a plot axis.
Note: This is an abstract class.
Constant defining a linear scale
Constant defining a logarithmic scale
Signal emitted when axis orientation has changed
Signal emitted when axis scale has changed
Signal emitted when axis autoscale has changed
Signal emitted when axis autoscale has changed
Get the limits of this axis.
Returns: | Minimum and maximum values of this axis as tuple |
---|
Set this axis limits.
Parameters: |
|
---|
Return True if the axis is inverted (top to bottom for the y-axis), False otherwise. It is always False for the X axis.
Return type: | bool |
---|
Set the axis orientation.
This is only available for the Y axis.
Parameters: | flag (bool) – True for Y axis going from top to bottom, False for Y axis going from bottom to top |
---|
Return the current displayed label of this axis.
Parameters: | axis (str) – The Y axis for which to get the label (left or right) |
---|---|
Return type: | str |
Set the label displayed on the plot for this axis.
The provided label can be temporarily replaced by the label of the active curve if any.
Parameters: | label (str) – The axis label |
---|
Return the name of the scale used by this axis.
Return type: | str |
---|
Set the scale to be used by this axis.
Parameters: | scale (str) – Name of the scale (“log”, or “linear”) |
---|
Return True if axis is automatically adjusting its limits.
Return type: | bool |
---|
Set the axis limits adjusting behavior of resetZoom().
Parameters: | flag (bool) – True to resize limits automatically, False to disable it. |
---|
Set a constaints on the position of the axes.
Parameters: |
|
---|---|
Returns: | True if the constaints was updated |
Return type: | bool |
Set a constaints on the position of the axes.
Parameters: |
|
---|---|
Returns: | True if the constaints was updated |
Return type: | bool |