- class itom.plotItem(figure, subplotIdx=0)¶
- class itom.plotItem(uiItem) plotItem
- class itom.plotItem(figure, objectID=0) plotItem
The plotItem is a special
uiItemand represents itom plot designer widgets.
This constructor can be used to get a reference of a plot in a
figure. The plot can also be in a subplot area of a figure. There are two main uses cases for the direct usage of this constructor:
If a reference to a general
uiItemis available, but the referenced widget / item is a plot, the
uiItemcan be cast to
plotItemsuch that additional methods like
If a reference to a
figureis available, that contains one or more plots, the reference to one of these plots can be obtained. The
subplotIdxindicates the specific plot, that should be referenced. The default is
0. If the figure consists of more than one subplot, the index counts the subplots row-by-row.
The 3rd variant of this contructor, using the keyword-based argument
objectIDis only internally used and has no further meaning for a high-level usage. However, if it is used,
objectIDmust be used as keyword argument, else
subplotIdxis assumed to be initialized.
figurewindow, that contains an itom plot.
The area index of the (sub)plot, that should be referenced. This index is considered to be row-wise, such that the center plot in the 2nd row with three plots in each row has the index
4. The first, left, plot in the first row has the index
0, which is the default.
If the internal
uiItemis available, it can be tried to be casted to
- drawAndPickElements(elementType, maxNrElements=1) Tuple[shape] ¶
This method forces the user to draw specific shapes on the canvas of the plot.
If this method is called, the script execution in paused until the requested
maxNrElementsof shapes of the given type
elementTypeare drawn by the user on the canvas of the plot. The coordinates of the shapes is then returned by this method. If the script execution is aborted during the interactive operation or if the user presses the
Esckey in the plot, this operation is stopped by a
The element type that the user should interactively draw on the canvas of the plot. Allowed types are:
Number of elements of the given type, the user has to draw. The operation can be aborted by clicking the
Esckey. If this is the case, a
if the user interrupts the selection (by pressing the Esc key).
- pickPoints(points, maxNrPoints=-1)¶
-> method to let the user pick points on a plot (only if plot supports this)
This method lets the user select one or multiple points (up to
maxNrPoints) in the canvas of the current plot (if the plot supports this). The operation can be aborted by pressing the
Esckey. Then a
RuntimeError` is raised. It can also be quit earlier by pressing the ``Spacekey. This is also required if an unlimited number of points can be selected (
maxNrPoints = -1).
This object will be a
2 x nrOfSelectedPoints
float64after the successful call of this method. The first row contains the
xcoordinates of the selected points, the 2nd row the
Let the user select up to this number of points. The selection can be stopped by pressing Space or Esc.
maxNrPointsmust be -1 for an unlimited number of picked points (default) or a number >= 1.
if the specific plot class does not provide the necessary methods to support this operation.
if the operation has been interrupted by the user.
pointsis an empty
dataObjectthen. An interruption can occur if the plot is closed or if the user pressed the escape key during the operation.
- PrimitiveCircle = 64¶
- PrimitiveEllipse = 32¶
- PrimitiveLine = 4¶
- PrimitiveMultiPointPick = 1¶
- PrimitivePoint = 2¶
- PrimitivePolygon = 128¶
- PrimitiveRectangle = 8¶
- PrimitiveSquare = 16¶