qcodes_loop.plots.pyqtgraph

Live plotting using pyqtgraph

class qcodes_loop.plots.pyqtgraph.QtPlot(*args, figsize: tuple[int, int] = (1000, 600), interval=0.25, window_title='', theme=((60, 60, 60), 'w'), show_window=True, remote=True, fig_x_position=None, fig_y_position=None, **kwargs)

Plot x/y lines or x/y/z heatmap data. The first trace may be included in the constructor, other traces can be added with QtPlot.add().

For information on how x/y/z *args are handled see add() in the

base plotting class.

Parameters:
  • *args – shortcut to provide the x/y/z data. See BasePlot.add

  • figsize – (width, height) tuple in pixels to pass to GraphicsWindow default (1000, 600)

  • interval – period in seconds between update checks default 0.25

  • theme – tuple of (foreground_color, background_color), where each is a valid Qt color. default (dark gray, white), opposite the pyqtgraph default of (white, black)

  • fig_x_pos – fraction of screen width to place the figure at 0 is all the way to the left and 1 is all the way to the right. default None let qt decide.

  • fig_y_pos – fraction of screen width to place the figure at 0 is all the way to the top and 1 is all the way to the bottom. default None let qt decide.

  • **kwargs – passed along to QtPlot.add() to add the first data trace

add_to_plot(subplot=1, **kwargs)

Add a trace the plot itself (typically called by self.add, which incorporates args into kwargs, so the subclass doesn’t need to worry about this). Data will be in x, y, and optionally z.

Should be implemented by a subclass, and each call should append a dictionary to self.traces, containing at least {‘config’: kwargs}

autorange(reset_colorbar: bool = False) None

Auto range all limits in case they were changed during interactive plot. Reset colormap if changed and resize window to original size.

Parameters:

reset_colorbar – Should the limits and colorscale of the colorbar be reset. Off by default

clear() None

Clears the plot window and removes all subplots and traces so that the window can be reused.

fixUnitScaling(startranges: dict[str, dict[str, float | int]] | None = None)

Disable SI rescaling if units are not standard units and limit ranges to data if known.

Parameters:

startranges – The plot can automatically infer the full ranges array parameters. However it has no knowledge of the ranges or regular parameters. You can explicitly pass in the values here as a dict of the form {‘paramtername’: {max: value, min:value}}

save(filename=None)

Save current plot to filename, by default to the location corresponding to the default title.

Parameters:

filename (Optional[str]) – Location of the file

setGeometry(x, y, w, h)

Set geometry of the plotting window

update_plot()

Update the plot itself (typically called by self.update). Should be implemented by a subclass

class qcodes_loop.plots.pyqtgraph.TransformState(translate, scale, revisit)
revisit

Alias for field number 2

scale

Alias for field number 1

translate

Alias for field number 0