Skip to content

Commit

Permalink
snippets update
Browse files Browse the repository at this point in the history
  • Loading branch information
klemengit committed May 15, 2023
1 parent 3ccc6ea commit 82b9eb2
Showing 1 changed file with 16 additions and 42 deletions.
58 changes: 16 additions & 42 deletions docs/source/snippets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,18 @@ Adjust the ``layout`` and ``subplot_options`` to your needs. See `visualization
acq = LadiskDAQ.NIAcquisition(input_task_name, acquisition_name=input_task_name)
# Live visualization
# Define the layout (adjust to your needs)
layout = {
input_task_name: {
(0, 0): [0],
(1, 0): [0],
}
}
# Define the subplot options (adjust to your needs)
subplot_options = {
(0, 0): {
'xlim': (0, 1),
'ylim': (-5, 5),
'axis_style': 'linear'
},
(1, 0): {
'xlim': (0, 1),
'ylim': (-5, 5),
'axis_style': 'linear'
}
}
# Create the Visualization object
vis = LadiskDAQ.Visualization(layout, subplot_options, nth="auto")
# Add lines
vis.add_lines((0, 0), source=input_task_name, channels=0)
vis.add_lines((1, 0), source=input_task_name, channels=1)
# Edit subplot options
vis.config_subplots((0, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
vis.config_subplots((1, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
# Create the Core object
ldaq = LadiskDAQ.Core(acq, visualization=vis)
Expand Down Expand Up @@ -133,31 +120,18 @@ To use multiple acquisition and generation sources, define them separately and p
gen = LadiskDAQ.NIGenerator(output_task_name, signal)
# Live visualization
# Define the layout (adjust to your needs)
layout = {
input_task_name: {
(0, 0): [0],
(1, 0): [0],
}
}
# Define the subplot options (adjust to your needs)
subplot_options = {
(0, 0): {
'xlim': (0, 1),
'ylim': (-5, 5),
'axis_style': 'linear'
},
(1, 0): {
'xlim': (0, 1),
'ylim': (-5, 5),
'axis_style': 'linear'
}
}
# Create the Visualization object
vis = LadiskDAQ.Visualization(layout, subplot_options, nth="auto")
# Add lines
vis.add_lines((0, 0), source=input_task_name, channels=0)
vis.add_lines((1, 0), source=input_task_name, channels=1)
# Edit subplot options
vis.config_subplots((0, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
vis.config_subplots((1, 0), xlim=(0, 1), ylim=(-5, 5), axis_style='linear')
# Create the Core object
ldaq = LadiskDAQ.Core(acq, gen, visualization=vis)
Expand Down

0 comments on commit 82b9eb2

Please sign in to comment.