pub struct PlotBars { /* private fields */ }
Expand description
Struct to provide bar plotting functionality.
Implementations§
Source§impl PlotBars
impl PlotBars
Sourcepub fn new(label: &str) -> Self
pub fn new(label: &str) -> Self
Create a new bar plot to be shown. Defaults to drawing vertical bars. Does not draw anything yet.
Sourcepub fn with_bar_width(self, bar_width: f64) -> Self
pub fn with_bar_width(self, bar_width: f64) -> Self
Set the width of the bars
Sourcepub fn with_horizontal_bars(self) -> Self
pub fn with_horizontal_bars(self) -> Self
Set the bars to be horizontal (default is vertical)
Sourcepub fn plot(&self, axis_positions: &[f64], bar_values: &[f64])
pub fn plot(&self, axis_positions: &[f64], bar_values: &[f64])
Draw a previously-created bar plot. Use this in closures passed to
Plot::build()
. The axis_positions
specify where on the corresponding axis (X for vertical mode, Y for horizontal mode) the
bar is drawn, and the bar_values
specify what values the bars have.
Auto Trait Implementations§
impl Freeze for PlotBars
impl RefUnwindSafe for PlotBars
impl Send for PlotBars
impl Sync for PlotBars
impl Unpin for PlotBars
impl UnwindSafe for PlotBars
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more