Struct rtplot::Figure[][src]

pub struct Figure<'a> { /* fields omitted */ }

Creates a figure that will wait to receive samples, then draw them onto the plot.

Implementations

impl<'a> Figure<'a>[src]

pub fn new(queue_size: usize) -> Self[src]

Create a figure with default settings.

pub fn new_with_config(config: FigureConfig<'a>, queue_size: usize) -> Self[src]

Create a figure from an existing configuration. Useful if you don’t want to use the builder pattern to initialize a figure from scratch.

pub fn xlim(self, xlim: [f32; 2]) -> Self[src]

Sets the x min and max limits for plotting.

pub fn ylim(self, ylim: [f32; 2]) -> Self[src]

Sets the y min and max limits for plotting.

pub fn xlabel(self, xlabel: &'a str) -> Self[src]

Sets the x label to display.

pub fn ylabel(self, ylabel: &'a str) -> Self[src]

Sets the y label to display.

pub fn color(self, r: u8, g: u8, b: u8) -> Self[src]

Sets the color of the line to draw.

pub fn plot_type(self, plot_type: PlotType) -> Self[src]

Sets the type of plot to generate.

pub fn should_close_window(&mut self) -> bool[src]

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.

pub fn plot_xy<T>(&mut self, points: &[(T, T)]) where
    T: Into<f32> + Copy
[src]

Take an array of 2D points and draw them to the plot. This overrides any samples in the queue.

pub fn plot_y<T>(&mut self, y_coords: &[T]) where
    T: Into<f32> + Copy
[src]

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.

pub fn plot_stream<T>(&mut self, y_coords: &[T]) where
    T: Into<f32> + Copy
[src]

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.

pub fn plot_complex_stream<T>(&mut self, points: &[Complex<T>]) where
    T: Into<f32> + Copy
[src]

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.

pub fn plot_complex<T>(&mut self, coords: &[Complex<T>]) where
    T: Into<f32> + Copy
[src]

Takes a slice of complex samples and draws them onto the plot. This overrides any existing samples in the queue.

pub fn display(figure: &mut Figure<'_>, plot_fn: impl FnMut(&mut Figure<'_>))[src]

Hijacks the current thread to run the plotting and event loop.

Trait Implementations

impl<'a> Default for Figure<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Figure<'a>

impl<'a> !Send for Figure<'a>

impl<'a> !Sync for Figure<'a>

impl<'a> Unpin for Figure<'a>

impl<'a> !UnwindSafe for Figure<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.