1pub mod axes;
7pub mod colors;
8pub mod dot;
9pub mod figure;
10pub mod markers;
11pub mod plot;
12pub mod prelude;
13pub mod utils;
14pub mod viewer;
15
16pub use axes::Axes;
17pub use colors::Color;
18pub use figure::Figure;
19pub use markers::Marker;
20pub use plot::{Plot, PlotType};
21
22pub trait IntoVec<T> {
24 fn into_vec(self) -> Vec<T>;
25}
26
27impl<T, Tp> IntoVec<T> for Tp
28where
29 Tp: Into<Vec<T>>,
30{
31 fn into_vec(self) -> Vec<T> {
32 self.into()
33 }
34}
35
36pub fn figure() -> Figure {
38 Figure::new()
39}
40
41pub fn figure_with_size(width: f64, height: f64) -> Figure {
43 Figure::with_size(width, height)
44}
45
46pub fn plot(x: &[f64], y: &[f64]) -> Figure {
48 let mut fig = Figure::new();
49 fig.add_subplot().plot(x, y);
50 fig
51}
52
53pub fn scatter(x: &[f64], y: &[f64]) -> Figure {
55 let mut fig = Figure::new();
56 fig.add_subplot().scatter(x, y);
57 fig
58}