Infinite Lines#

squap.inf_dline(
pos,
angle=45,
color='y',
width=1,
dashed=False,
dash_pattern=None,
line_style=None,
movable=False,
bounds=None,
span=(0, 1),
line_movable=None,
label=False,
label_text='{value}',
label_movable=None,
label_position=0.5,
label_anchors=None,
hover_color='red',
hover_width=1,
name=None,
**kwargs,
)[source]#

Creates an infinite line with any orientation and add it to the view.

Parameters:
  • pos (float or tuple) – A position through which the line runs. When angle is 0 or 90 this can be a single value: the y- or x-value of the line respectively.

  • angle (float) – The angle of the line in degrees. 0 is horizontal, 90 is vertical. Default is 45.

  • color (ColorType) – Color of the line. Default is "y" (yellow). Can also be a gradient.

  • width (int) – Width of the plot line. Default is 1.

  • dashed (bool) – If True, draws a dashed line between the points (for more options see dash_pattern). Default is False.

  • dash_pattern (list, optional) – How the dashes are spaced. For example, if dash_pattern is [16, 16, 4, 16], the pattern will be: one dash of 16 pixels long, then a space of 16 pixels long, then a dash of 4 pixels long and then a dash of 16 pixels long. This pattern is then repeated. This should be a list with a length that is an integer multiple of 2. Setting dash_pattern will also automatically set dashed to True. Defaults to [16, 16].

  • line_style (str) – todo: some presets for simplicity, ls is also allowed instead of line_style.

  • movable (bool, optional) – Whether the line (and label if it exists) is movable or not. Default is False.

  • bounds (tuple, optional) – Optional (min, max) bounding values. Bounds are only valid if the line is vertical or horizontal. Default is no bounds.

  • span (tuple) – The length of the line on screen. The first number is how far it extends to todo: complete

  • line_movable (bool, optional) – Whether the line is movable or not. Overwrites movable if changed. Default is None.

  • label (bool) – The label doesn’t work completely yet, I think this is due to pyqtgraph itself. Will look into this later. If True, a label is added to the line. Default is False.

  • label_text (str) – The text that is shown on the label. {value} can be used inside the string, which will be replaced by the lines current position. Default is "{value}".

  • label_movable (bool, optional) – Whether the label is movable or not. Overwrites movable if changed. Default is None.

  • label_position (float) – The relative position (between 0.0 and 1.0) of this label within the view box and along the line. Default is 0.5, meaning in the middle.

  • label_anchors (list, optional) – todo: write

  • hover_color (ColorType) – Color to use when the mouse cursor hovers over the line. Only used when movable=True. Default is red.

  • hover_width (int) – Width to use when the mouse cursor hovers over the line. Default is 1.

  • name (str, optional) – Name of the item (for the legend).

  • **kwargs – Some aliases are allowed.

Returns:

The generated line.

Return type:

InfLine

squap.inf_hline(
pos,
color='y',
width=1,
dashed=False,
dash_pattern=None,
line_style=None,
movable=False,
bounds=None,
span=(0, 1),
line_movable=None,
label=False,
label_text='{value}',
label_movable=None,
label_position=0.5,
label_anchors=None,
hover_color='red',
hover_width=1,
name=None,
**kwargs,
)[source]#

This function is used to create a horizontal infinite line and add it to the view. This function is the same as inf_dline(pos, angle=90, ...) but instead the default label_text is now "y={value}".

squap.inf_vline(
pos,
color='y',
width=1,
dashed=False,
dash_pattern=None,
line_style=None,
movable=False,
bounds=None,
span=(0, 1),
line_movable=None,
label=False,
label_text='{value}',
label_movable=None,
label_position=0.5,
label_anchors=None,
hover_color='red',
hover_width=1,
name=None,
**kwargs,
)[source]#

This function is used to create a horizontal infinite line and add it to the view. This function is the same as inf_dline(pos, angle=90, ...) but instead the default label_text is now "x={value}".