Plot Window Control#

squap.set_xlim(x_min, x_max)[source]#

Sets the view range in the x direction.

Parameters:
  • x_min (float) – minimum x value for the plot range

  • x_max (float) – maximum x value for the plot range

squap.set_ylim(y_min, y_max)[source]#

Sets the view range in the x direction.

Parameters:
  • y_min (float) – minimum y value for the plot range

  • y_max (float) – maximum y value for the plot range

squap.xlim()[source]#

Returns current xlim.

Return type:

tuple[float]

squap.ylim()[source]#

” Returns current ylim.

Return type:

tuple[float]

squap.set_xlabel(
label,
unit='',
right_side=False,
)[source]#

Sets a label on the x-axis.

Parameters:
  • label (str) – Text that gets displayed on the x-axis.

  • unit (str) – Unit can be added as seperate argument.

  • right_side (bool) – The text can be displayed on the opposite site too by setting this parameter to True.

squap.set_ylabel(
label,
unit='',
top_side=False,
)[source]#

Sets a label on the y-axis.

Parameters:
  • label (str) – Text that gets displayed on the y-axis.

  • unit (str) – Unit can be added as seperate argument.

  • top_side (bool) – The text can be displayed on the opposite site too by setting this parameter to True.

squap.show_grid(x=None, y=None, alpha=None)[source]#

Show or hide the grid for either axis. For more detailed control see squap.grid().

Parameters:
  • x (bool, optional) – Show grid on the x-axis, starts off as False.

  • y (bool, optional) – Show grid on the y-axis, starts off as False.

  • alpha (float, optional) – Opacity of the grid, float between 0. and 1..

squap.disable_flicker(disable=True)[source]#

This function can be called to disable the flickering that sometimes occur with fast updating plots. It does slow down plotting.

squap.enable_autoscale(
axis=None,
enable=True,
x=None,
y=None,
)[source]#

Enables (or disables) auto-range for axis, which may be "x", "y", or "xy" for both (if axis is omitted, both axes will be changed). When enabled, the axis will automatically rescale when items are added/removed or change their shape. The argument enable may optionally be a float (0.0 to 1.0) which indicates the fraction of the data that should be visible. Also allows setting x and or y to True for simpler interface.

Parameters:
  • axis (str, optional) – Axis to autoscale. Can be "x", "y", or "xy", or None for both. Defaults to None.

  • enable (bool) – Whether to enable or disable. Defaults to True.

  • x (bool, optional) – optional simpler interface. Setting this to True enables autoscaling in the x-direction. Defaults to None.

  • y (bool, optional) – optional simpler interface. Setting this to True enables autoscaling in the y-direction. Defaults to None.

squap.disable_autoscale(
axis=None,
x=None,
y=None,
)[source]#

Disables auto-scale. (Equivalent to enable_autoscale(enable=False))

squap.enable_autopan(
axis=None,
enable=True,
x=None,
y=None,
)[source]#

Enables (or disables) autopan for axis, which may be "x", "y", or "xy" for both (if axis is omitted, both axes will be changed). Only does something when autoscaling is enabled. When enabled, the axis will automatically pan to objects in the plot meaning the zoom level stays the same but the offset changes. The argument enable may optionally be a float (0.0 to 1.0) which indicates the fraction of the data that should be visible. Also allows setting x and or y to True for simpler interface.

Parameters:
  • axis (str, optional) – Axis to autoscale. Can be "x", "y", or "xy", or None for both. Defaults to None.

  • enable (bool) – Whether to enable or disable. Defaults to True.

  • x (bool, optional) – optional simpler interface. Setting this to True enables autoscaling in the x-direction. Defaults to None.

  • y (bool, optional) – optional simpler interface. Setting this to True enables autoscaling in the y-direction. Defaults to None.

squap.disable_autopan(
axis=None,
x=None,
y=None,
)[source]#

Disables auto-scale. (Equivalent to enable_autopan(enable=False))

squap.lock_zoom(curves)[source]#

Locks zoom onto current range of specified curves. Works only if they are normal curves with x- and y- data.

Parameters:

curves (list of curves) – curves on which the zoom should lock

squap.subplots(
nrows=1,
ncols=1,
heightratios=None,
widthratios=None,
)[source]#

Initialises a subplot window and gives a 1D or 2D list of PlotWidgets.

Parameters:
  • nrows (int) – number of rows.

  • ncols (int) – number of columns.

  • heightratios (list of int, optional) – ratios between the heights of the rows. Defaults to all ones. Only integer values allowed. Not working yet!(?)

  • widthratios (list of int, optional) – ratios between the widths of the columns. Defaults to all ones. Only integer values allowed. Not working yet!(?)

Returns:

Possibly nested list of plot widgets on which different plots can be drawn.

Return type:

list of PlotWidget

squap.merge_plots(plots)[source]#

Merge multiple subplots into a single plot. This is used for unevenly spaced grids of subplots.

Parameters:

plots (list of SubplotWidget) – list of plots to merge.

Returns:

One new plot object in place of the merged plots.

Return type:

SubplotWidget

todo: adjust for QTableWidget

squap.set_title(text)[source]#

Sets title to str(text).

Args

text (str or Any): title, can be a string or any argument accepted by str

squap.remove_item(item)[source]#

Remove item item from the figure. Item can be anything that can be added to a plot widget.

squap.clear()[source]#

Clear everything. Todo: check