pub struct Figure<'a> { /* private fields */ }
Expand description
Creates a figure that will wait to receive samples, then draw them onto the plot.
Implementations§
Source§impl<'a> Figure<'a>
impl<'a> Figure<'a>
Sourcepub fn new_with_config(config: FigureConfig<'a>, queue_size: usize) -> Self
pub fn new_with_config(config: FigureConfig<'a>, queue_size: usize) -> Self
Create a figure from an existing configuration. Useful if you don’t want to use the builder pattern to initialize a figure from scratch.
Sourcepub fn should_close_window(&mut self) -> bool
pub fn should_close_window(&mut self) -> bool
Checks events to see if the figure should close or not. Returns true if the window received a close event, false otherwise. In most cases, you don’t need to handle events yourself; use Figure::display() instead.
Sourcepub fn plot_xy<T>(&mut self, points: &[(T, T)])
pub fn plot_xy<T>(&mut self, points: &[(T, T)])
Take an array of 2D points and draw them to the plot. This overrides any samples in the queue.
Sourcepub fn plot_y<T>(&mut self, y_coords: &[T])
pub fn plot_y<T>(&mut self, y_coords: &[T])
Takes a series of real samples and draws them onto the plot. This overrides any samples in the queue. The x-axis will be interpolated.
Sourcepub fn plot_stream<T>(&mut self, y_coords: &[T])
pub fn plot_stream<T>(&mut self, y_coords: &[T])
Takes a series of real samples and draws them onto the plot. Samples received from the stream are appended to the queue and any samples exceeding the queue size are removed. The x-axis will be interpolated.
Sourcepub fn plot_complex_stream<T>(&mut self, points: &[Complex<T>])
pub fn plot_complex_stream<T>(&mut self, points: &[Complex<T>])
Takes a slice of complex samples and draws them onto the plot. Samples received from the stream are appended to the queue and any samples exceeding the queue size are removed.
Sourcepub fn plot_complex<T>(&mut self, coords: &[Complex<T>])
pub fn plot_complex<T>(&mut self, coords: &[Complex<T>])
Takes a slice of complex samples and draws them onto the plot. This overrides any existing samples in the queue.