qcodespp.plotting.RemotePlot
Classes
Functions
Module Contents
- qcodespp.plotting.RemotePlot.live_plot(*args, data_set=None, data_items=None)
Entry point for live plotting of qcodespp data.
- Args:
- *args (DataSetPP, DataArray, Parameter, list, tuple): Positional arguments can be:
DataSetPP
: The dataset to link to the live plot.DataArray
orParameter
: The data items to plot.A list or tuple of
DataArray
orParameter
objects to plot.
- data_set (
DataSetPP
, optional): TheDataSetPP
to link to the live plot. If not provided, it will try to use the default dataset. If no data_set, one can add items to the plot, but the data will not be tracked.
- data_items (Sequence[
DataArray
,Parameter
], optional): List ofDataArray
or
Parameter
objects to plot. If not provided, nothing will be plotted initially, the user can usePlot.add()
later.
- Returns:
The
Plot
instance.
- class qcodespp.plotting.RemotePlot.ControlListener(client_ready_event=None, port=8876)
Bases:
threading.Thread
ListenToClientTask
- client_ready_event = None
- context
- socket
- port
- poller
- running = True
- run()
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- class qcodespp.plotting.RemotePlot.Plot(title=None, name=None)
Class to create live plot instances.
Most methods of this class should not be called directly; only add(), add_multiple(), clear() and close() should be used by the user.
- Args:
title (str, optional): Title of the plot window. name (str, optional): Name of the plot instance. If not provided, a random UUID will be used.
- context
- socket
- port = 8876
- encoding = 'utf-8'
- topic = 'qcodes.plot.00000000000000000000000000000000'
- metadata
- data_uuid = '00000000000000000000000000000000'
- client_ready_event
- control_task
- control_port
- publish(data, uuid=None)
- publish_data(data, uuid, meta, arrays)
- add_metadata(new_metadata, uuid=None)
- store(loop_indices, ids_values, uuid)
- save_metadata(metadata, uuid=None)
- finalize(uuid=None)
- new_client(name=None)
- clear()
- add_multiple(*z_params)
Add multiple
DataArray
s to thePlot
.- Args:
- *z_params (Sequence [DataArray]): DataArrays to be added to the Plot.
Each DataArray is added to a separate subplot.
- add(*args, x=None, y=None, z=None, subplot=0, name=None, title=None, position=None, relativeto=None, xlabel=None, ylabel=None, zlabel=None, xunit=None, yunit=None, zunit=None, silent=True, linecuts=False, symbol=None, size=None, **kwargs)
Add a trace to the plot.
- Args:
- *args (DataArray): positional arguments, can be:
y
orz
: specify just the 1D or 2D data independent parameter, with the setpointaxis or axes implied from the DataSetPP setpoints.
x, y
orx, y, z
: specify all axes of the data.
x (DataArray, optional): x-axis data. y (DataArray, optional): y-axis data. z (DataArray, optional): z-axis data. subplot (int, optional): Subplot index to add the trace to. Defaults to 0. name (str, optional): Name of the trace. If not provided, the name of the DataArray will be used. title (str, optional): Title of the trace. If not provided, the name of the DataArray will be used. position (str): Position of the subplot in the plot window. Options are ‘bottom’, ‘top’, ‘left’, ‘right’, ‘above’, or ‘below’. relativeto (str, optional): Position relative to which the subplot should be placed. xlabel (str, optional): Label for the x-axis. If not provided, the label of the DataArray will be used. ylabel (str, optional): Label for the y-axis. If not provided, the label of the DataArray will be used. zlabel (str, optional): Label for the z-axis. If not provided, the label of the DataArray will be used. xunit (str, optional): Unit for the x-axis. If not provided, the unit of the DataArray will be used. yunit (str, optional): Unit for the y-axis. If not provided, the unit of the DataArray will be used. zunit (str, optional): Unit for the z-axis. If not provided, the unit of the DataArray will be used. silent (bool, optional): If True, do not wait for the client to be ready. Defaults to True. linecuts (bool, optional): If True, plot line cuts instead of a 2D image. Defaults to False. symbol (str, optional): Symbol to use for the trace. Defaults to None. size (int, optional): Size of the symbol. Defaults to None.
- expand_trace(args, kwargs)
Complete the x, y (and possibly z) data definition for a trace.
Also modifies kwargs in place so that all the data needed to fully specify the trace is present (ie either x and y or x and y and z)
Both
__init__
(for the first trace) and theadd
method support multiple ways to specify the data in the trace:- As args:
add(y)
oradd(z)
specify just the main 1D or 2D data, with the setpoint axis or axes implied.add(x, y)
oradd(x, y, z)
specify all axes of the data.
- And as kwargs:
add(x=x, y=y, z=z)
you specify exactly the data you want on each axis. Any but the last (y or z) can be omitted, which allows for all of the same forms as with args, plus x and z or y and z, with just one axis implied from the setpoints of the z data.
This method takes any of those forms and converts them into a complete set of kwargs, containing all of the explicit or implied data to be used in plotting this trace.
- Args:
args (Tuple[DataArray]): positional args, as passed to either
__init__
oradd
kwargs (Dict(DataArray]): keyword args, as passed to either__init__
oradd
.kwargs may contain non-data items in keys other than x, y, and z.
- Raises:
ValueError: if the shape of the data does not match that of args ValueError: if the data is provided twice
- set_title(title)
- set_cmap(cmap)
- save(filename=None, subplot=None)
- set_xlabel(label, subplot=0)
- set_ylabel(label, subplot=0)
- set_geometry(height, width, x0, y0)
- close()