pub struct Plot {
pub xs: Matrix,
pub ys: Matrix,
pub line_desc: Vec<LineDesc>,
pub axis_desc: AxisDesc,
pub desc: Desc,
}
Fields
xs: Matrix
ys: Matrix
line_desc: Vec<LineDesc>
axis_desc: AxisDesc
desc: Desc
Implementations
sourceimpl Plot
impl Plot
pub fn new<A: PlotArg>(args: A) -> Plot
pub fn set_desc(&mut self, desc: Desc)
sourcepub fn set_color(&mut self, r: f32, g: f32, b: f32)
pub fn set_color(&mut self, r: f32, g: f32, b: f32)
Set graph color
Example
use graplot::Plot;
let mut plot = Plot::new([1., 2., 3.]);
plot.set_color(0., 0.78, 1.);
plot.show();
sourcepub fn color(&mut self, idx: usize, color: Color)
pub fn color(&mut self, idx: usize, color: Color)
Colors the graph at the given index with the color.
Example
use graplot::{Plot, BLUE};
let mut plot = Plot::new([1., 2., 3.,]);
plot.add([2., 3., 4.,]);
plot.color(1, BLUE);
plot.show();
pub fn add<A: PlotArg>(&mut self, args: A)
pub fn set_title(&mut self, title: &str)
pub fn set_xlabel(&mut self, label: &str)
pub fn set_ylabel(&mut self, label: &str)
pub fn show(self)
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Plot
impl Send for Plot
impl Sync for Plot
impl Unpin for Plot
impl UnwindSafe for Plot
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more