Skip to content

Commit 82b9eb2

Browse files
committed
snippets update
1 parent 3ccc6ea commit 82b9eb2

File tree

1 file changed

+16
-42
lines changed

1 file changed

+16
-42
lines changed

docs/source/snippets.rst

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,31 +60,18 @@ Adjust the ``layout`` and ``subplot_options`` to your needs. See `visualization
6060
acq = LadiskDAQ.NIAcquisition(input_task_name, acquisition_name=input_task_name)
6161
6262
# Live visualization
63-
# Define the layout (adjust to your needs)
64-
layout = {
65-
input_task_name: {
66-
(0, 0): [0],
67-
(1, 0): [0],
68-
}
69-
}
70-
71-
# Define the subplot options (adjust to your needs)
72-
subplot_options = {
73-
(0, 0): {
74-
'xlim': (0, 1),
75-
'ylim': (-5, 5),
76-
'axis_style': 'linear'
77-
},
78-
(1, 0): {
79-
'xlim': (0, 1),
80-
'ylim': (-5, 5),
81-
'axis_style': 'linear'
82-
}
83-
}
8463
8564
# Create the Visualization object
8665
vis = LadiskDAQ.Visualization(layout, subplot_options, nth="auto")
8766
67+
# Add lines
68+
vis.add_lines((0, 0), source=input_task_name, channels=0)
69+
vis.add_lines((1, 0), source=input_task_name, channels=1)
70+
71+
# Edit subplot options
72+
vis.config_subplots((0, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
73+
vis.config_subplots((1, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
74+
8875
8976
# Create the Core object
9077
ldaq = LadiskDAQ.Core(acq, visualization=vis)
@@ -133,31 +120,18 @@ To use multiple acquisition and generation sources, define them separately and p
133120
gen = LadiskDAQ.NIGenerator(output_task_name, signal)
134121
135122
# Live visualization
136-
# Define the layout (adjust to your needs)
137-
layout = {
138-
input_task_name: {
139-
(0, 0): [0],
140-
(1, 0): [0],
141-
}
142-
}
143-
144-
# Define the subplot options (adjust to your needs)
145-
subplot_options = {
146-
(0, 0): {
147-
'xlim': (0, 1),
148-
'ylim': (-5, 5),
149-
'axis_style': 'linear'
150-
},
151-
(1, 0): {
152-
'xlim': (0, 1),
153-
'ylim': (-5, 5),
154-
'axis_style': 'linear'
155-
}
156-
}
157123
158124
# Create the Visualization object
159125
vis = LadiskDAQ.Visualization(layout, subplot_options, nth="auto")
160126
127+
# Add lines
128+
vis.add_lines((0, 0), source=input_task_name, channels=0)
129+
vis.add_lines((1, 0), source=input_task_name, channels=1)
130+
131+
# Edit subplot options
132+
vis.config_subplots((0, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
133+
vis.config_subplots((1, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
134+
161135
162136
# Create the Core object
163137
ldaq = LadiskDAQ.Core(acq, gen, visualization=vis)

0 commit comments

Comments
 (0)