plotpy.annotations¶
- The annotations module provides annotated shapes:
An annotated shape is a plot item (derived from QwtPlotItem) that may be
displayed on a 2D plotting widget like plotpy.curve.CurvePlot
or plotpy.image.ImagePlot
.
See also
module plotpy.shapes
Examples¶
- An annotated shape may be created:
- from the associated plot item class (e.g. AnnotatedCircle to
create an annotated circle): the item properties are then assigned
by creating the appropriate style parameters object
(
plotpy.styles.AnnotationParam
)
- from the associated plot item class (e.g. AnnotatedCircle to
create an annotated circle): the item properties are then assigned
by creating the appropriate style parameters object
(
>>> from plotpy.annotations import AnnotatedCircle
>>> from plotpy.styles import AnnotationParam
>>> param = AnnotationParam()
>>> param.title = 'My circle'
>>> circle_item = AnnotatedCircle(0., 2., 4., 0., param)
- or using the plot item builder (see
plotpy.builder.make()
):
>>> from plotpy.builder import make
>>> circle_item = make.annotated_circle(0., 2., 4., 0., title='My circle')
Reference¶
-
class
plotpy.annotations.
AnnotatedPoint
(x=0, y=0, annotationparam=None)[source]¶ Construct an annotated point at coordinates (x, y) with properties set with annotationparam (see
plotpy.styles.AnnotationParam
)-
attach
(plot)¶ Attach the item to a plot.
This method will attach a QwtPlotItem to the QwtPlot argument. It will first detach the QwtPlotItem from any plot from a previous call to attach (if necessary). If a None argument is passed, it will detach from any QwtPlot it was attached to.
Parameters: plot (qwt.plot.QwtPlot) – Plot widget See also
-
boundingRect
()¶ Returns: An invalid bounding rect: QRectF(1.0, 1.0, -2.0, -2.0) Note
A width or height < 0.0 is ignored by the autoscaler
-
create_label
()¶ Return the label object associated to this annotated shape object
-
defaultIcon
(brush, size)¶ Return a default icon from a brush
The default icon is a filled rectangle used in several derived classes as legendIcon().
Parameters: - brush (QBrush) – Fill brush
- size (QSizeF) – Icon size
Returns: A filled rectangle
-
deserialize
(reader)¶ Deserialize object from HDF5 reader
-
detach
()¶ Detach the item from a plot.
This method detaches a QwtPlotItem from any QwtPlot it has been associated with.
See also
-
getCanvasMarginHint
(xMap, yMap, canvasRect)¶ Calculate a hint for the canvas margin
When the QwtPlotItem::Margins flag is enabled the plot item indicates, that it needs some margins at the borders of the canvas. This is f.e. used by bar charts to reserve space for displaying the bars.
The margins are in target device coordinates ( pixels on screen )
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
- canvasRect (QRectF) – Contents rectangle of the canvas in painter coordinates
See also
QwtPlot.getCanvasMarginsHint()
,QwtPlot.updateCanvasMargins()
,
-
get_center
()¶ Return shape center coordinates: (xc, yc)
-
get_text
()¶ Return text associated to current shape (see
plotpy.label.ObjectInfo
)
-
get_tr_center
()¶ Return shape center coordinates after applying transform matrix
-
get_tr_center_str
()¶ Return center coordinates as a string (with units)
-
get_tr_size
()¶ Return shape size after applying transform matrix
-
get_tr_size_str
()¶ Return size as a string (with units)
-
hide
()¶ Hide the item
-
isVisible
()¶ Returns: True if visible See also
-
is_label_visible
()¶ Return True if associated label is visible
-
is_private
()¶ Return True if object is private
-
is_readonly
()¶ Return object readonly state
-
itemChanged
()¶ Update the legend and call QwtPlot.autoRefresh() for the parent plot.
See also
QwtPlot.legendChanged()
,QwtPlot.autoRefresh()
-
legendChanged
()¶ Update the legend of the parent plot.
See also
QwtPlot.updateLegend()
,itemChanged()
-
legendData
()¶ Return all information, that is needed to represent the item on the legend
QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend.
The default implementation returns one entry with the title() of the item and the legendIcon().
Returns: Data, that is needed to represent the item on the legend See also
title()
,legendIcon()
,qwt.legend.QwtLegend
-
legendIcon
(index, size)¶ Parameters: - index (int) – Index of the legend entry (usually there is only one)
- size (QSizeF) – Icon size
Returns: Icon representing the item on the legend
The default implementation returns an invalid icon
See also
-
legendIconSize
()¶ Returns: Legend icon size See also
-
move_local_point_to
(handle, pos, ctrl=None)¶ Move a handle as returned by hit_test to the new position pos ctrl: True if <Ctrl> button is being pressed, False otherwise
-
move_with_selection
(delta_x, delta_y)¶ Translate the shape together with other selected items delta_x, delta_y: translation in plot coordinates
-
paintRect
(xMap, yMap)¶ Calculate the bounding paint rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding paint rectangle of the scale maps, not normalized
-
plot
()¶ Returns: attached plot
-
rtti
()¶ Return rtti for the specific class represented. QwtPlotItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
Returns: rtti value
-
scaleRect
(xMap, yMap)¶ Calculate the bounding scale rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding scale rect of the scale maps, not normalized
-
select
()¶ Select item
-
serialize
(writer)¶ Serialize object to HDF5 writer
-
setAxes
(xAxis, yAxis)¶ Set X and Y axis
The item will painted according to the coordinates of its Axes.
Parameters: - xAxis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop)
- yAxis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight)
See also
-
setAxis
(xAxis, yAxis)¶ Set X and Y axis
Warning
setAxis has been removed in Qwt6: please use
setAxes()
instead
-
setItemAttribute
(attribute, on=True)¶ Toggle an item attribute
Parameters: - attribute (int) – Attribute type
- on (bool) – True/False
See also
-
setItemInterest
(interest, on=True)¶ Toggle an item interest
Parameters: - attribute (int) – Interest type
- on (bool) – True/False
See also
-
setLegendIconSize
(size)¶ Set the size of the legend icon
The default setting is 8x8 pixels
Parameters: size (QSize) – Size See also
-
setRenderHint
(hint, on=True)¶ Toggle a render hint
Parameters: - hint (int) – Render hint
- on (bool) – True/False
See also
-
setTitle
(title)¶ Set a new title
Parameters: title (qwt.text.QwtText or str) – Title See also
-
setVisible
(on)¶ Show/Hide the item
Parameters: on (bool) – Show if True, otherwise hide See also
-
setXAxis
(axis)¶ Set the X axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop) See also
-
setYAxis
(axis)¶ Set the Y axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight) See also
-
setZ
(z)¶ Set the z value
Plot items are painted in increasing z-order.
Parameters: z (float) – Z-value See also
z()
,QwtPlotDict.itemList()
-
set_label_visible
(state)¶ Set the annotated shape’s label visibility
-
set_movable
(state)¶ Set item movable state
-
set_private
(state)¶ Set object as private
-
set_readonly
(state)¶ Set object readonly state
-
set_resizable
(state)¶ Set item resizable state (or any action triggered when moving an handle, e.g. rotation)
-
set_rotatable
(state)¶ Set item rotatable state
-
set_selectable
(state)¶ Set item selectable state
-
show
()¶ Show the item
-
testItemAttribute
(attribute)¶ Test an item attribute
Parameters: attribute (int) – Attribute type Returns: True/False See also
-
testItemInterest
(interest)¶ Test an item interest
Parameters: attribute (int) – Interest type Returns: True/False See also
-
testRenderHint
(hint)¶ Test a render hint
Parameters: attribute (int) – Render hint Returns: True/False See also
-
title
()¶ Returns: Title of the item See also
-
unselect
()¶ Unselect item
-
updateLegend
(item, data)¶ Update the item to changes of the legend info
Plot items that want to display a legend ( not those, that want to be displayed on a legend ! ) will have to implement updateLegend().
updateLegend() is only called when the LegendInterest interest is enabled. The default implementation does nothing.
Parameters: - item (qwt.plot.QwtPlotItem) – Plot item to be displayed on a legend
- data (list) – Attributes how to display item on the legend
Note
Plot items, that want to be displayed on a legend need to enable the QwtPlotItem.Legend flag and to implement legendData() and legendIcon()
-
update_item_parameters
()¶ Update item parameters (dataset) from object properties
-
update_label
()¶ Update the annotated shape’s label contents
-
xAxis
()¶ Returns: xAxis
-
x_to_str
(x)¶ Convert x (float) to a string (with associated unit and uncertainty)
-
yAxis
()¶ Returns: yAxis
-
y_to_str
(y)¶ Convert y (float) to a string (with associated unit and uncertainty)
-
-
class
plotpy.annotations.
AnnotatedSegment
(x1=0, y1=0, x2=0, y2=0, annotationparam=None)[source]¶ Construct an annotated segment between coordinates (x1, y1) and (x2, y2) with properties set with annotationparam (see
plotpy.styles.AnnotationParam
)-
set_rect
(x1, y1, x2, y2)[source]¶ Set the coordinates of the shape’s top-left corner to (x1, y1), and of its bottom-right corner to (x2, y2).
-
attach
(plot)¶ Attach the item to a plot.
This method will attach a QwtPlotItem to the QwtPlot argument. It will first detach the QwtPlotItem from any plot from a previous call to attach (if necessary). If a None argument is passed, it will detach from any QwtPlot it was attached to.
Parameters: plot (qwt.plot.QwtPlot) – Plot widget See also
-
boundingRect
()¶ Returns: An invalid bounding rect: QRectF(1.0, 1.0, -2.0, -2.0) Note
A width or height < 0.0 is ignored by the autoscaler
-
create_label
()¶ Return the label object associated to this annotated shape object
-
create_shape
()¶ Return the shape object associated to this annotated shape object
-
defaultIcon
(brush, size)¶ Return a default icon from a brush
The default icon is a filled rectangle used in several derived classes as legendIcon().
Parameters: - brush (QBrush) – Fill brush
- size (QSizeF) – Icon size
Returns: A filled rectangle
-
deserialize
(reader)¶ Deserialize object from HDF5 reader
-
detach
()¶ Detach the item from a plot.
This method detaches a QwtPlotItem from any QwtPlot it has been associated with.
See also
-
getCanvasMarginHint
(xMap, yMap, canvasRect)¶ Calculate a hint for the canvas margin
When the QwtPlotItem::Margins flag is enabled the plot item indicates, that it needs some margins at the borders of the canvas. This is f.e. used by bar charts to reserve space for displaying the bars.
The margins are in target device coordinates ( pixels on screen )
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
- canvasRect (QRectF) – Contents rectangle of the canvas in painter coordinates
See also
QwtPlot.getCanvasMarginsHint()
,QwtPlot.updateCanvasMargins()
,
-
get_center
()¶ Return shape center coordinates: (xc, yc)
-
get_text
()¶ Return text associated to current shape (see
plotpy.label.ObjectInfo
)
-
get_tr_center
()¶ Return shape center coordinates after applying transform matrix
-
get_tr_center_str
()¶ Return center coordinates as a string (with units)
-
get_tr_size
()¶ Return shape size after applying transform matrix
-
get_tr_size_str
()¶ Return size as a string (with units)
-
hide
()¶ Hide the item
-
isVisible
()¶ Returns: True if visible See also
-
is_label_visible
()¶ Return True if associated label is visible
-
is_private
()¶ Return True if object is private
-
is_readonly
()¶ Return object readonly state
-
itemChanged
()¶ Update the legend and call QwtPlot.autoRefresh() for the parent plot.
See also
QwtPlot.legendChanged()
,QwtPlot.autoRefresh()
-
legendChanged
()¶ Update the legend of the parent plot.
See also
QwtPlot.updateLegend()
,itemChanged()
-
legendData
()¶ Return all information, that is needed to represent the item on the legend
QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend.
The default implementation returns one entry with the title() of the item and the legendIcon().
Returns: Data, that is needed to represent the item on the legend See also
title()
,legendIcon()
,qwt.legend.QwtLegend
-
legendIcon
(index, size)¶ Parameters: - index (int) – Index of the legend entry (usually there is only one)
- size (QSizeF) – Icon size
Returns: Icon representing the item on the legend
The default implementation returns an invalid icon
See also
-
legendIconSize
()¶ Returns: Legend icon size See also
-
move_local_point_to
(handle, pos, ctrl=None)¶ Move a handle as returned by hit_test to the new position pos ctrl: True if <Ctrl> button is being pressed, False otherwise
-
move_with_selection
(delta_x, delta_y)¶ Translate the shape together with other selected items delta_x, delta_y: translation in plot coordinates
-
paintRect
(xMap, yMap)¶ Calculate the bounding paint rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding paint rectangle of the scale maps, not normalized
-
plot
()¶ Returns: attached plot
-
rtti
()¶ Return rtti for the specific class represented. QwtPlotItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
Returns: rtti value
-
scaleRect
(xMap, yMap)¶ Calculate the bounding scale rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding scale rect of the scale maps, not normalized
-
select
()¶ Select item
-
serialize
(writer)¶ Serialize object to HDF5 writer
-
setAxes
(xAxis, yAxis)¶ Set X and Y axis
The item will painted according to the coordinates of its Axes.
Parameters: - xAxis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop)
- yAxis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight)
See also
-
setAxis
(xAxis, yAxis)¶ Set X and Y axis
Warning
setAxis has been removed in Qwt6: please use
setAxes()
instead
-
setItemAttribute
(attribute, on=True)¶ Toggle an item attribute
Parameters: - attribute (int) – Attribute type
- on (bool) – True/False
See also
-
setItemInterest
(interest, on=True)¶ Toggle an item interest
Parameters: - attribute (int) – Interest type
- on (bool) – True/False
See also
-
setLegendIconSize
(size)¶ Set the size of the legend icon
The default setting is 8x8 pixels
Parameters: size (QSize) – Size See also
-
setRenderHint
(hint, on=True)¶ Toggle a render hint
Parameters: - hint (int) – Render hint
- on (bool) – True/False
See also
-
setTitle
(title)¶ Set a new title
Parameters: title (qwt.text.QwtText or str) – Title See also
-
setVisible
(on)¶ Show/Hide the item
Parameters: on (bool) – Show if True, otherwise hide See also
-
setXAxis
(axis)¶ Set the X axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop) See also
-
setYAxis
(axis)¶ Set the Y axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight) See also
-
setZ
(z)¶ Set the z value
Plot items are painted in increasing z-order.
Parameters: z (float) – Z-value See also
z()
,QwtPlotDict.itemList()
-
set_label_visible
(state)¶ Set the annotated shape’s label visibility
-
set_movable
(state)¶ Set item movable state
-
set_private
(state)¶ Set object as private
-
set_readonly
(state)¶ Set object readonly state
-
set_resizable
(state)¶ Set item resizable state (or any action triggered when moving an handle, e.g. rotation)
-
set_rotatable
(state)¶ Set item rotatable state
-
set_selectable
(state)¶ Set item selectable state
-
show
()¶ Show the item
-
testItemAttribute
(attribute)¶ Test an item attribute
Parameters: attribute (int) – Attribute type Returns: True/False See also
-
testItemInterest
(interest)¶ Test an item interest
Parameters: attribute (int) – Interest type Returns: True/False See also
-
testRenderHint
(hint)¶ Test a render hint
Parameters: attribute (int) – Render hint Returns: True/False See also
-
title
()¶ Returns: Title of the item See also
-
unselect
()¶ Unselect item
-
updateLegend
(item, data)¶ Update the item to changes of the legend info
Plot items that want to display a legend ( not those, that want to be displayed on a legend ! ) will have to implement updateLegend().
updateLegend() is only called when the LegendInterest interest is enabled. The default implementation does nothing.
Parameters: - item (qwt.plot.QwtPlotItem) – Plot item to be displayed on a legend
- data (list) – Attributes how to display item on the legend
Note
Plot items, that want to be displayed on a legend need to enable the QwtPlotItem.Legend flag and to implement legendData() and legendIcon()
-
update_item_parameters
()¶ Update item parameters (dataset) from object properties
-
update_label
()¶ Update the annotated shape’s label contents
-
xAxis
()¶ Returns: xAxis
-
x_to_str
(x)¶ Convert x (float) to a string (with associated unit and uncertainty)
-
yAxis
()¶ Returns: yAxis
-
y_to_str
(y)¶ Convert y (float) to a string (with associated unit and uncertainty)
-
-
class
plotpy.annotations.
AnnotatedRectangle
(x1=0, y1=0, x2=0, y2=0, annotationparam=None)[source]¶ Construct an annotated rectangle between coordinates (x1, y1) and (x2, y2) with properties set with annotationparam (see
plotpy.styles.AnnotationParam
)-
set_rect
(x1, y1, x2, y2)[source]¶ Set the coordinates of the shape’s top-left corner to (x1, y1), and of its bottom-right corner to (x2, y2).
-
attach
(plot)¶ Attach the item to a plot.
This method will attach a QwtPlotItem to the QwtPlot argument. It will first detach the QwtPlotItem from any plot from a previous call to attach (if necessary). If a None argument is passed, it will detach from any QwtPlot it was attached to.
Parameters: plot (qwt.plot.QwtPlot) – Plot widget See also
-
boundingRect
()¶ Returns: An invalid bounding rect: QRectF(1.0, 1.0, -2.0, -2.0) Note
A width or height < 0.0 is ignored by the autoscaler
-
create_label
()¶ Return the label object associated to this annotated shape object
-
create_shape
()¶ Return the shape object associated to this annotated shape object
-
defaultIcon
(brush, size)¶ Return a default icon from a brush
The default icon is a filled rectangle used in several derived classes as legendIcon().
Parameters: - brush (QBrush) – Fill brush
- size (QSizeF) – Icon size
Returns: A filled rectangle
-
deserialize
(reader)¶ Deserialize object from HDF5 reader
-
detach
()¶ Detach the item from a plot.
This method detaches a QwtPlotItem from any QwtPlot it has been associated with.
See also
-
getCanvasMarginHint
(xMap, yMap, canvasRect)¶ Calculate a hint for the canvas margin
When the QwtPlotItem::Margins flag is enabled the plot item indicates, that it needs some margins at the borders of the canvas. This is f.e. used by bar charts to reserve space for displaying the bars.
The margins are in target device coordinates ( pixels on screen )
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
- canvasRect (QRectF) – Contents rectangle of the canvas in painter coordinates
See also
QwtPlot.getCanvasMarginsHint()
,QwtPlot.updateCanvasMargins()
,
-
get_center
()¶ Return shape center coordinates: (xc, yc)
-
get_text
()¶ Return text associated to current shape (see
plotpy.label.ObjectInfo
)
-
get_tr_center_str
()¶ Return center coordinates as a string (with units)
-
get_tr_size_str
()¶ Return size as a string (with units)
-
hide
()¶ Hide the item
-
isVisible
()¶ Returns: True if visible See also
-
is_label_visible
()¶ Return True if associated label is visible
-
is_private
()¶ Return True if object is private
-
is_readonly
()¶ Return object readonly state
-
itemChanged
()¶ Update the legend and call QwtPlot.autoRefresh() for the parent plot.
See also
QwtPlot.legendChanged()
,QwtPlot.autoRefresh()
-
legendChanged
()¶ Update the legend of the parent plot.
See also
QwtPlot.updateLegend()
,itemChanged()
-
legendData
()¶ Return all information, that is needed to represent the item on the legend
QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend.
The default implementation returns one entry with the title() of the item and the legendIcon().
Returns: Data, that is needed to represent the item on the legend See also
title()
,legendIcon()
,qwt.legend.QwtLegend
-
legendIcon
(index, size)¶ Parameters: - index (int) – Index of the legend entry (usually there is only one)
- size (QSizeF) – Icon size
Returns: Icon representing the item on the legend
The default implementation returns an invalid icon
See also
-
legendIconSize
()¶ Returns: Legend icon size See also
-
move_local_point_to
(handle, pos, ctrl=None)¶ Move a handle as returned by hit_test to the new position pos ctrl: True if <Ctrl> button is being pressed, False otherwise
-
move_with_selection
(delta_x, delta_y)¶ Translate the shape together with other selected items delta_x, delta_y: translation in plot coordinates
-
paintRect
(xMap, yMap)¶ Calculate the bounding paint rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding paint rectangle of the scale maps, not normalized
-
plot
()¶ Returns: attached plot
-
rtti
()¶ Return rtti for the specific class represented. QwtPlotItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
Returns: rtti value
-
scaleRect
(xMap, yMap)¶ Calculate the bounding scale rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding scale rect of the scale maps, not normalized
-
select
()¶ Select item
-
serialize
(writer)¶ Serialize object to HDF5 writer
-
setAxes
(xAxis, yAxis)¶ Set X and Y axis
The item will painted according to the coordinates of its Axes.
Parameters: - xAxis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop)
- yAxis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight)
See also
-
setAxis
(xAxis, yAxis)¶ Set X and Y axis
Warning
setAxis has been removed in Qwt6: please use
setAxes()
instead
-
setItemAttribute
(attribute, on=True)¶ Toggle an item attribute
Parameters: - attribute (int) – Attribute type
- on (bool) – True/False
See also
-
setItemInterest
(interest, on=True)¶ Toggle an item interest
Parameters: - attribute (int) – Interest type
- on (bool) – True/False
See also
-
setLegendIconSize
(size)¶ Set the size of the legend icon
The default setting is 8x8 pixels
Parameters: size (QSize) – Size See also
-
setRenderHint
(hint, on=True)¶ Toggle a render hint
Parameters: - hint (int) – Render hint
- on (bool) – True/False
See also
-
setTitle
(title)¶ Set a new title
Parameters: title (qwt.text.QwtText or str) – Title See also
-
setVisible
(on)¶ Show/Hide the item
Parameters: on (bool) – Show if True, otherwise hide See also
-
setXAxis
(axis)¶ Set the X axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop) See also
-
setYAxis
(axis)¶ Set the Y axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight) See also
-
setZ
(z)¶ Set the z value
Plot items are painted in increasing z-order.
Parameters: z (float) – Z-value See also
z()
,QwtPlotDict.itemList()
-
set_label_visible
(state)¶ Set the annotated shape’s label visibility
-
set_movable
(state)¶ Set item movable state
-
set_private
(state)¶ Set object as private
-
set_readonly
(state)¶ Set object readonly state
-
set_resizable
(state)¶ Set item resizable state (or any action triggered when moving an handle, e.g. rotation)
-
set_rotatable
(state)¶ Set item rotatable state
-
set_selectable
(state)¶ Set item selectable state
-
show
()¶ Show the item
-
testItemAttribute
(attribute)¶ Test an item attribute
Parameters: attribute (int) – Attribute type Returns: True/False See also
-
testItemInterest
(interest)¶ Test an item interest
Parameters: attribute (int) – Interest type Returns: True/False See also
-
testRenderHint
(hint)¶ Test a render hint
Parameters: attribute (int) – Render hint Returns: True/False See also
-
title
()¶ Returns: Title of the item See also
-
unselect
()¶ Unselect item
-
updateLegend
(item, data)¶ Update the item to changes of the legend info
Plot items that want to display a legend ( not those, that want to be displayed on a legend ! ) will have to implement updateLegend().
updateLegend() is only called when the LegendInterest interest is enabled. The default implementation does nothing.
Parameters: - item (qwt.plot.QwtPlotItem) – Plot item to be displayed on a legend
- data (list) – Attributes how to display item on the legend
Note
Plot items, that want to be displayed on a legend need to enable the QwtPlotItem.Legend flag and to implement legendData() and legendIcon()
-
update_item_parameters
()¶ Update item parameters (dataset) from object properties
-
update_label
()¶ Update the annotated shape’s label contents
-
xAxis
()¶ Returns: xAxis
-
x_to_str
(x)¶ Convert x (float) to a string (with associated unit and uncertainty)
-
yAxis
()¶ Returns: yAxis
-
y_to_str
(y)¶ Convert y (float) to a string (with associated unit and uncertainty)
-
-
class
plotpy.annotations.
AnnotatedObliqueRectangle
(x0=0, y0=0, x1=0, y1=0, x2=0, y2=0, x3=0, y3=0, annotationparam=None)[source]¶ Construct an annotated oblique rectangle between coordinates (x0, y0), (x1, y1), (x2, y2) and (x3, y3) with properties set with annotationparam (see
plotpy.styles.AnnotationParam
)-
get_tr_angle
()[source]¶ Return X-diameter angle with horizontal direction, after applying transform matrix
-
set_rect
(x0, y0, x1, y1, x2, y2, x3, y3)[source]¶ Set the rectangle corners coordinates:
(x0, y0): top-left corner (x1, y1): top-right corner (x2, y2): bottom-right corner (x3, y3): bottom-left cornerx: additionnal points (x0, y0)------>(x1, y1) ↑ | | | x x | | | ↓ (x3, y3)<------(x2, y2)
-
attach
(plot)¶ Attach the item to a plot.
This method will attach a QwtPlotItem to the QwtPlot argument. It will first detach the QwtPlotItem from any plot from a previous call to attach (if necessary). If a None argument is passed, it will detach from any QwtPlot it was attached to.
Parameters: plot (qwt.plot.QwtPlot) – Plot widget See also
-
boundingRect
()¶ Returns: An invalid bounding rect: QRectF(1.0, 1.0, -2.0, -2.0) Note
A width or height < 0.0 is ignored by the autoscaler
-
create_label
()¶ Return the label object associated to this annotated shape object
-
defaultIcon
(brush, size)¶ Return a default icon from a brush
The default icon is a filled rectangle used in several derived classes as legendIcon().
Parameters: - brush (QBrush) – Fill brush
- size (QSizeF) – Icon size
Returns: A filled rectangle
-
deserialize
(reader)¶ Deserialize object from HDF5 reader
-
detach
()¶ Detach the item from a plot.
This method detaches a QwtPlotItem from any QwtPlot it has been associated with.
See also
-
getCanvasMarginHint
(xMap, yMap, canvasRect)¶ Calculate a hint for the canvas margin
When the QwtPlotItem::Margins flag is enabled the plot item indicates, that it needs some margins at the borders of the canvas. This is f.e. used by bar charts to reserve space for displaying the bars.
The margins are in target device coordinates ( pixels on screen )
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
- canvasRect (QRectF) – Contents rectangle of the canvas in painter coordinates
See also
QwtPlot.getCanvasMarginsHint()
,QwtPlot.updateCanvasMargins()
,
-
get_center
()¶ Return shape center coordinates: (xc, yc)
-
get_computations_text
()¶ Return formatted string with informations on current shape
-
get_rect
()¶ Return the coordinates of the shape’s top-left and bottom-right corners
-
get_text
()¶ Return text associated to current shape (see
plotpy.label.ObjectInfo
)
-
get_tr_center
()¶ Return shape center coordinates after applying transform matrix
-
get_tr_center_str
()¶ Return center coordinates as a string (with units)
-
get_tr_size_str
()¶ Return size as a string (with units)
-
hide
()¶ Hide the item
-
isVisible
()¶ Returns: True if visible See also
-
is_label_visible
()¶ Return True if associated label is visible
-
is_private
()¶ Return True if object is private
-
is_readonly
()¶ Return object readonly state
-
itemChanged
()¶ Update the legend and call QwtPlot.autoRefresh() for the parent plot.
See also
QwtPlot.legendChanged()
,QwtPlot.autoRefresh()
-
legendChanged
()¶ Update the legend of the parent plot.
See also
QwtPlot.updateLegend()
,itemChanged()
-
legendData
()¶ Return all information, that is needed to represent the item on the legend
QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend.
The default implementation returns one entry with the title() of the item and the legendIcon().
Returns: Data, that is needed to represent the item on the legend See also
title()
,legendIcon()
,qwt.legend.QwtLegend
-
legendIcon
(index, size)¶ Parameters: - index (int) – Index of the legend entry (usually there is only one)
- size (QSizeF) – Icon size
Returns: Icon representing the item on the legend
The default implementation returns an invalid icon
See also
-
legendIconSize
()¶ Returns: Legend icon size See also
-
move_local_point_to
(handle, pos, ctrl=None)¶ Move a handle as returned by hit_test to the new position pos ctrl: True if <Ctrl> button is being pressed, False otherwise
-
move_with_selection
(delta_x, delta_y)¶ Translate the shape together with other selected items delta_x, delta_y: translation in plot coordinates
-
paintRect
(xMap, yMap)¶ Calculate the bounding paint rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding paint rectangle of the scale maps, not normalized
-
plot
()¶ Returns: attached plot
-
rtti
()¶ Return rtti for the specific class represented. QwtPlotItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
Returns: rtti value
-
scaleRect
(xMap, yMap)¶ Calculate the bounding scale rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding scale rect of the scale maps, not normalized
-
select
()¶ Select item
-
serialize
(writer)¶ Serialize object to HDF5 writer
-
setAxes
(xAxis, yAxis)¶ Set X and Y axis
The item will painted according to the coordinates of its Axes.
Parameters: - xAxis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop)
- yAxis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight)
See also
-
setAxis
(xAxis, yAxis)¶ Set X and Y axis
Warning
setAxis has been removed in Qwt6: please use
setAxes()
instead
-
setItemAttribute
(attribute, on=True)¶ Toggle an item attribute
Parameters: - attribute (int) – Attribute type
- on (bool) – True/False
See also
-
setItemInterest
(interest, on=True)¶ Toggle an item interest
Parameters: - attribute (int) – Interest type
- on (bool) – True/False
See also
-
setLegendIconSize
(size)¶ Set the size of the legend icon
The default setting is 8x8 pixels
Parameters: size (QSize) – Size See also
-
setRenderHint
(hint, on=True)¶ Toggle a render hint
Parameters: - hint (int) – Render hint
- on (bool) – True/False
See also
-
setTitle
(title)¶ Set a new title
Parameters: title (qwt.text.QwtText or str) – Title See also
-
setVisible
(on)¶ Show/Hide the item
Parameters: on (bool) – Show if True, otherwise hide See also
-
setXAxis
(axis)¶ Set the X axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop) See also
-
setYAxis
(axis)¶ Set the Y axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight) See also
-
setZ
(z)¶ Set the z value
Plot items are painted in increasing z-order.
Parameters: z (float) – Z-value See also
z()
,QwtPlotDict.itemList()
-
set_label_visible
(state)¶ Set the annotated shape’s label visibility
-
set_movable
(state)¶ Set item movable state
-
set_private
(state)¶ Set object as private
-
set_readonly
(state)¶ Set object readonly state
-
set_resizable
(state)¶ Set item resizable state (or any action triggered when moving an handle, e.g. rotation)
-
set_rotatable
(state)¶ Set item rotatable state
-
set_selectable
(state)¶ Set item selectable state
-
show
()¶ Show the item
-
testItemAttribute
(attribute)¶ Test an item attribute
Parameters: attribute (int) – Attribute type Returns: True/False See also
-
testItemInterest
(interest)¶ Test an item interest
Parameters: attribute (int) – Interest type Returns: True/False See also
-
testRenderHint
(hint)¶ Test a render hint
Parameters: attribute (int) – Render hint Returns: True/False See also
-
title
()¶ Returns: Title of the item See also
-
unselect
()¶ Unselect item
-
updateLegend
(item, data)¶ Update the item to changes of the legend info
Plot items that want to display a legend ( not those, that want to be displayed on a legend ! ) will have to implement updateLegend().
updateLegend() is only called when the LegendInterest interest is enabled. The default implementation does nothing.
Parameters: - item (qwt.plot.QwtPlotItem) – Plot item to be displayed on a legend
- data (list) – Attributes how to display item on the legend
Note
Plot items, that want to be displayed on a legend need to enable the QwtPlotItem.Legend flag and to implement legendData() and legendIcon()
-
update_item_parameters
()¶ Update item parameters (dataset) from object properties
-
update_label
()¶ Update the annotated shape’s label contents
-
xAxis
()¶ Returns: xAxis
-
x_to_str
(x)¶ Convert x (float) to a string (with associated unit and uncertainty)
-
yAxis
()¶ Returns: yAxis
-
y_to_str
(y)¶ Convert y (float) to a string (with associated unit and uncertainty)
-
-
class
plotpy.annotations.
AnnotatedEllipse
(x1=0, y1=0, x2=0, y2=0, annotationparam=None)[source]¶ Construct an annotated ellipse with X-axis diameter between coordinates (x1, y1) and (x2, y2) and properties set with annotationparam (see
plotpy.styles.AnnotationParam
)-
set_xdiameter
(x0, y0, x1, y1)[source]¶ Set the coordinates of the ellipse’s X-axis diameter Warning: transform matrix is not applied here
-
get_xdiameter
()[source]¶ Return the coordinates of the ellipse’s X-axis diameter Warning: transform matrix is not applied here
-
set_ydiameter
(x2, y2, x3, y3)[source]¶ Set the coordinates of the ellipse’s Y-axis diameter Warning: transform matrix is not applied here
-
get_ydiameter
()[source]¶ Return the coordinates of the ellipse’s Y-axis diameter Warning: transform matrix is not applied here
-
get_tr_angle
()[source]¶ Return X-diameter angle with horizontal direction, after applying transform matrix
-
attach
(plot)¶ Attach the item to a plot.
This method will attach a QwtPlotItem to the QwtPlot argument. It will first detach the QwtPlotItem from any plot from a previous call to attach (if necessary). If a None argument is passed, it will detach from any QwtPlot it was attached to.
Parameters: plot (qwt.plot.QwtPlot) – Plot widget See also
-
boundingRect
()¶ Returns: An invalid bounding rect: QRectF(1.0, 1.0, -2.0, -2.0) Note
A width or height < 0.0 is ignored by the autoscaler
-
create_label
()¶ Return the label object associated to this annotated shape object
-
create_shape
()¶ Return the shape object associated to this annotated shape object
-
defaultIcon
(brush, size)¶ Return a default icon from a brush
The default icon is a filled rectangle used in several derived classes as legendIcon().
Parameters: - brush (QBrush) – Fill brush
- size (QSizeF) – Icon size
Returns: A filled rectangle
-
deserialize
(reader)¶ Deserialize object from HDF5 reader
-
detach
()¶ Detach the item from a plot.
This method detaches a QwtPlotItem from any QwtPlot it has been associated with.
See also
-
getCanvasMarginHint
(xMap, yMap, canvasRect)¶ Calculate a hint for the canvas margin
When the QwtPlotItem::Margins flag is enabled the plot item indicates, that it needs some margins at the borders of the canvas. This is f.e. used by bar charts to reserve space for displaying the bars.
The margins are in target device coordinates ( pixels on screen )
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
- canvasRect (QRectF) – Contents rectangle of the canvas in painter coordinates
See also
QwtPlot.getCanvasMarginsHint()
,QwtPlot.updateCanvasMargins()
,
-
get_center
()¶ Return shape center coordinates: (xc, yc)
-
get_text
()¶ Return text associated to current shape (see
plotpy.label.ObjectInfo
)
-
get_tr_center_str
()¶ Return center coordinates as a string (with units)
-
get_tr_size_str
()¶ Return size as a string (with units)
-
hide
()¶ Hide the item
-
isVisible
()¶ Returns: True if visible See also
-
is_label_visible
()¶ Return True if associated label is visible
-
is_private
()¶ Return True if object is private
-
is_readonly
()¶ Return object readonly state
-
itemChanged
()¶ Update the legend and call QwtPlot.autoRefresh() for the parent plot.
See also
QwtPlot.legendChanged()
,QwtPlot.autoRefresh()
-
legendChanged
()¶ Update the legend of the parent plot.
See also
QwtPlot.updateLegend()
,itemChanged()
-
legendData
()¶ Return all information, that is needed to represent the item on the legend
QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend.
The default implementation returns one entry with the title() of the item and the legendIcon().
Returns: Data, that is needed to represent the item on the legend See also
title()
,legendIcon()
,qwt.legend.QwtLegend
-
legendIcon
(index, size)¶ Parameters: - index (int) – Index of the legend entry (usually there is only one)
- size (QSizeF) – Icon size
Returns: Icon representing the item on the legend
The default implementation returns an invalid icon
See also
-
legendIconSize
()¶ Returns: Legend icon size See also
-
move_local_point_to
(handle, pos, ctrl=None)¶ Move a handle as returned by hit_test to the new position pos ctrl: True if <Ctrl> button is being pressed, False otherwise
-
move_with_selection
(delta_x, delta_y)¶ Translate the shape together with other selected items delta_x, delta_y: translation in plot coordinates
-
paintRect
(xMap, yMap)¶ Calculate the bounding paint rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding paint rectangle of the scale maps, not normalized
-
plot
()¶ Returns: attached plot
-
rtti
()¶ Return rtti for the specific class represented. QwtPlotItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
Returns: rtti value
-
scaleRect
(xMap, yMap)¶ Calculate the bounding scale rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding scale rect of the scale maps, not normalized
-
select
()¶ Select item
-
serialize
(writer)¶ Serialize object to HDF5 writer
-
setAxes
(xAxis, yAxis)¶ Set X and Y axis
The item will painted according to the coordinates of its Axes.
Parameters: - xAxis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop)
- yAxis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight)
See also
-
setAxis
(xAxis, yAxis)¶ Set X and Y axis
Warning
setAxis has been removed in Qwt6: please use
setAxes()
instead
-
setItemAttribute
(attribute, on=True)¶ Toggle an item attribute
Parameters: - attribute (int) – Attribute type
- on (bool) – True/False
See also
-
setItemInterest
(interest, on=True)¶ Toggle an item interest
Parameters: - attribute (int) – Interest type
- on (bool) – True/False
See also
-
setLegendIconSize
(size)¶ Set the size of the legend icon
The default setting is 8x8 pixels
Parameters: size (QSize) – Size See also
-
setRenderHint
(hint, on=True)¶ Toggle a render hint
Parameters: - hint (int) – Render hint
- on (bool) – True/False
See also
-
setTitle
(title)¶ Set a new title
Parameters: title (qwt.text.QwtText or str) – Title See also
-
setVisible
(on)¶ Show/Hide the item
Parameters: on (bool) – Show if True, otherwise hide See also
-
setXAxis
(axis)¶ Set the X axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop) See also
-
setYAxis
(axis)¶ Set the Y axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight) See also
-
setZ
(z)¶ Set the z value
Plot items are painted in increasing z-order.
Parameters: z (float) – Z-value See also
z()
,QwtPlotDict.itemList()
-
set_label_visible
(state)¶ Set the annotated shape’s label visibility
-
set_movable
(state)¶ Set item movable state
-
set_private
(state)¶ Set object as private
-
set_readonly
(state)¶ Set object readonly state
-
set_resizable
(state)¶ Set item resizable state (or any action triggered when moving an handle, e.g. rotation)
-
set_rotatable
(state)¶ Set item rotatable state
-
set_selectable
(state)¶ Set item selectable state
-
show
()¶ Show the item
-
testItemAttribute
(attribute)¶ Test an item attribute
Parameters: attribute (int) – Attribute type Returns: True/False See also
-
testItemInterest
(interest)¶ Test an item interest
Parameters: attribute (int) – Interest type Returns: True/False See also
-
testRenderHint
(hint)¶ Test a render hint
Parameters: attribute (int) – Render hint Returns: True/False See also
-
title
()¶ Returns: Title of the item See also
-
unselect
()¶ Unselect item
-
updateLegend
(item, data)¶ Update the item to changes of the legend info
Plot items that want to display a legend ( not those, that want to be displayed on a legend ! ) will have to implement updateLegend().
updateLegend() is only called when the LegendInterest interest is enabled. The default implementation does nothing.
Parameters: - item (qwt.plot.QwtPlotItem) – Plot item to be displayed on a legend
- data (list) – Attributes how to display item on the legend
Note
Plot items, that want to be displayed on a legend need to enable the QwtPlotItem.Legend flag and to implement legendData() and legendIcon()
-
update_item_parameters
()¶ Update item parameters (dataset) from object properties
-
update_label
()¶ Update the annotated shape’s label contents
-
xAxis
()¶ Returns: xAxis
-
x_to_str
(x)¶ Convert x (float) to a string (with associated unit and uncertainty)
-
yAxis
()¶ Returns: yAxis
-
y_to_str
(y)¶ Convert y (float) to a string (with associated unit and uncertainty)
-
-
class
plotpy.annotations.
AnnotatedCircle
(x1=0, y1=0, x2=0, y2=0, annotationparam=None)[source]¶ Construct an annotated circle with diameter between coordinates (x1, y1) and (x2, y2) and properties set with annotationparam (see
plotpy.styles.AnnotationParam
)-
attach
(plot)¶ Attach the item to a plot.
This method will attach a QwtPlotItem to the QwtPlot argument. It will first detach the QwtPlotItem from any plot from a previous call to attach (if necessary). If a None argument is passed, it will detach from any QwtPlot it was attached to.
Parameters: plot (qwt.plot.QwtPlot) – Plot widget See also
-
boundingRect
()¶ Returns: An invalid bounding rect: QRectF(1.0, 1.0, -2.0, -2.0) Note
A width or height < 0.0 is ignored by the autoscaler
-
create_label
()¶ Return the label object associated to this annotated shape object
-
create_shape
()¶ Return the shape object associated to this annotated shape object
-
defaultIcon
(brush, size)¶ Return a default icon from a brush
The default icon is a filled rectangle used in several derived classes as legendIcon().
Parameters: - brush (QBrush) – Fill brush
- size (QSizeF) – Icon size
Returns: A filled rectangle
-
deserialize
(reader)¶ Deserialize object from HDF5 reader
-
detach
()¶ Detach the item from a plot.
This method detaches a QwtPlotItem from any QwtPlot it has been associated with.
See also
-
getCanvasMarginHint
(xMap, yMap, canvasRect)¶ Calculate a hint for the canvas margin
When the QwtPlotItem::Margins flag is enabled the plot item indicates, that it needs some margins at the borders of the canvas. This is f.e. used by bar charts to reserve space for displaying the bars.
The margins are in target device coordinates ( pixels on screen )
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
- canvasRect (QRectF) – Contents rectangle of the canvas in painter coordinates
See also
QwtPlot.getCanvasMarginsHint()
,QwtPlot.updateCanvasMargins()
,
-
get_center
()¶ Return shape center coordinates: (xc, yc)
-
get_text
()¶ Return text associated to current shape (see
plotpy.label.ObjectInfo
)
-
get_tr_angle
()¶ Return X-diameter angle with horizontal direction, after applying transform matrix
-
get_tr_center
()¶ Return center coordinates: (xc, yc)
-
get_tr_center_str
()¶ Return center coordinates as a string (with units)
-
get_tr_size
()¶ Return shape size after applying transform matrix
-
get_tr_size_str
()¶ Return size as a string (with units)
-
get_xdiameter
()¶ Return the coordinates of the ellipse’s X-axis diameter Warning: transform matrix is not applied here
-
get_ydiameter
()¶ Return the coordinates of the ellipse’s Y-axis diameter Warning: transform matrix is not applied here
-
hide
()¶ Hide the item
-
isVisible
()¶ Returns: True if visible See also
-
is_label_visible
()¶ Return True if associated label is visible
-
is_private
()¶ Return True if object is private
-
is_readonly
()¶ Return object readonly state
-
itemChanged
()¶ Update the legend and call QwtPlot.autoRefresh() for the parent plot.
See also
QwtPlot.legendChanged()
,QwtPlot.autoRefresh()
-
legendChanged
()¶ Update the legend of the parent plot.
See also
QwtPlot.updateLegend()
,itemChanged()
-
legendData
()¶ Return all information, that is needed to represent the item on the legend
QwtLegendData is basically a list of QVariants that makes it possible to overload and reimplement legendData() to return almost any type of information, that is understood by the receiver that acts as the legend.
The default implementation returns one entry with the title() of the item and the legendIcon().
Returns: Data, that is needed to represent the item on the legend See also
title()
,legendIcon()
,qwt.legend.QwtLegend
-
legendIcon
(index, size)¶ Parameters: - index (int) – Index of the legend entry (usually there is only one)
- size (QSizeF) – Icon size
Returns: Icon representing the item on the legend
The default implementation returns an invalid icon
See also
-
legendIconSize
()¶ Returns: Legend icon size See also
-
move_local_point_to
(handle, pos, ctrl=None)¶ Move a handle as returned by hit_test to the new position pos ctrl: True if <Ctrl> button is being pressed, False otherwise
-
move_with_selection
(delta_x, delta_y)¶ Translate the shape together with other selected items delta_x, delta_y: translation in plot coordinates
-
paintRect
(xMap, yMap)¶ Calculate the bounding paint rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding paint rectangle of the scale maps, not normalized
-
plot
()¶ Returns: attached plot
-
rtti
()¶ Return rtti for the specific class represented. QwtPlotItem is simply a virtual interface class, and base classes will implement this method with specific rtti values so a user can differentiate them.
Returns: rtti value
-
scaleRect
(xMap, yMap)¶ Calculate the bounding scale rectangle of 2 maps
Parameters: - xMap (qwt.scale_map.QwtScaleMap) – Maps x-values into pixel coordinates.
- yMap (qwt.scale_map.QwtScaleMap) – Maps y-values into pixel coordinates.
Returns: Bounding scale rect of the scale maps, not normalized
-
select
()¶ Select item
-
serialize
(writer)¶ Serialize object to HDF5 writer
-
setAxes
(xAxis, yAxis)¶ Set X and Y axis
The item will painted according to the coordinates of its Axes.
Parameters: - xAxis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop)
- yAxis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight)
See also
-
setAxis
(xAxis, yAxis)¶ Set X and Y axis
Warning
setAxis has been removed in Qwt6: please use
setAxes()
instead
-
setItemAttribute
(attribute, on=True)¶ Toggle an item attribute
Parameters: - attribute (int) – Attribute type
- on (bool) – True/False
See also
-
setItemInterest
(interest, on=True)¶ Toggle an item interest
Parameters: - attribute (int) – Interest type
- on (bool) – True/False
See also
-
setLegendIconSize
(size)¶ Set the size of the legend icon
The default setting is 8x8 pixels
Parameters: size (QSize) – Size See also
-
setRenderHint
(hint, on=True)¶ Toggle a render hint
Parameters: - hint (int) – Render hint
- on (bool) – True/False
See also
-
setTitle
(title)¶ Set a new title
Parameters: title (qwt.text.QwtText or str) – Title See also
-
setVisible
(on)¶ Show/Hide the item
Parameters: on (bool) – Show if True, otherwise hide See also
-
setXAxis
(axis)¶ Set the X axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – X Axis (QwtPlot.xBottom or QwtPlot.xTop) See also
-
setYAxis
(axis)¶ Set the Y axis
The item will painted according to the coordinates its Axes.
Parameters: axis (int) – Y Axis (QwtPlot.yLeft or QwtPlot.yRight) See also
-
setZ
(z)¶ Set the z value
Plot items are painted in increasing z-order.
Parameters: z (float) – Z-value See also
z()
,QwtPlotDict.itemList()
-
set_label_position
()¶ Set label position, for instance based on shape position
-
set_label_visible
(state)¶ Set the annotated shape’s label visibility
-
set_movable
(state)¶ Set item movable state
-
set_private
(state)¶ Set object as private
-
set_readonly
(state)¶ Set object readonly state
-
set_resizable
(state)¶ Set item resizable state (or any action triggered when moving an handle, e.g. rotation)
-
set_rotatable
(state)¶ Set item rotatable state
-
set_selectable
(state)¶ Set item selectable state
-
set_xdiameter
(x0, y0, x1, y1)¶ Set the coordinates of the ellipse’s X-axis diameter Warning: transform matrix is not applied here
-
set_ydiameter
(x2, y2, x3, y3)¶ Set the coordinates of the ellipse’s Y-axis diameter Warning: transform matrix is not applied here
-
show
()¶ Show the item
-
testItemAttribute
(attribute)¶ Test an item attribute
Parameters: attribute (int) – Attribute type Returns: True/False See also
-
testItemInterest
(interest)¶ Test an item interest
Parameters: attribute (int) – Interest type Returns: True/False See also
-
testRenderHint
(hint)¶ Test a render hint
Parameters: attribute (int) – Render hint Returns: True/False See also
-
title
()¶ Returns: Title of the item See also
-
unselect
()¶ Unselect item
-
updateLegend
(item, data)¶ Update the item to changes of the legend info
Plot items that want to display a legend ( not those, that want to be displayed on a legend ! ) will have to implement updateLegend().
updateLegend() is only called when the LegendInterest interest is enabled. The default implementation does nothing.
Parameters: - item (qwt.plot.QwtPlotItem) – Plot item to be displayed on a legend
- data (list) – Attributes how to display item on the legend
Note
Plot items, that want to be displayed on a legend need to enable the QwtPlotItem.Legend flag and to implement legendData() and legendIcon()
-
update_item_parameters
()¶ Update item parameters (dataset) from object properties
-
update_label
()¶ Update the annotated shape’s label contents
-
xAxis
()¶ Returns: xAxis
-
x_to_str
(x)¶ Convert x (float) to a string (with associated unit and uncertainty)
-
yAxis
()¶ Returns: yAxis
-
y_to_str
(y)¶ Convert y (float) to a string (with associated unit and uncertainty)
-