from matplotlib import pyplot
from vortex import Range
from vortex.scan import RasterScan
from vortex_tools.scan import plot_annotated_waveforms_space

fig, axs = pyplot.subplots(1, 2)

scan = RasterScan()
cfg = scan.config
cfg.volume_extent = Range.symmetric(2)
cfg.segments_per_volume = 20
cfg.samples_per_segment = 100
cfg.loop = True
scan.initialize(cfg)

plot_annotated_waveforms_space(scan.scan_buffer(), scan.scan_markers(), inactive_marker=None, scan_line='w-', axes=axs[0])
axs[0].set_title('Raster')

scan = RasterScan()
cfg = scan.config
cfg.volume_extent = Range.symmetric(2)
cfg.segments_per_volume = 5
cfg.samples_per_segment = 100
cfg.loop = True
scan.initialize(cfg)

plot_annotated_waveforms_space(scan.scan_buffer(), scan.scan_markers(), inactive_marker=None, scan_line='w-', axes=axs[1])
axs[1].set_title('Raster')

fig.tight_layout()