rustplotlib/backend/
mod.rs

1mod mpl;
2#[cfg(feature = "native")]
3mod mpl_native;
4
5use std::io;
6
7pub use self::mpl::Matplotlib;
8#[cfg(feature = "native")]
9pub use self::mpl_native::MatplotlibNative;
10
11
12pub trait Backend {
13  fn figure(&mut self) -> io::Result<&mut Self>;
14  fn subplot(&mut self, i: u32, j: u32, k: u32) -> io::Result<&mut Self>;
15  fn grid(&mut self, grid: bool) -> io::Result<&mut Self>;
16  fn legend(&mut self, loc: &str) -> io::Result<&mut Self>;
17  fn xlim(&mut self, xlim: &(f64, f64)) -> io::Result<&mut Self>;
18  fn ylim(&mut self, ylim: &(f64, f64)) -> io::Result<&mut Self>;
19  fn set_style(&mut self, stylename: &str) -> io::Result<&mut Self>;
20  fn savefig(&mut self, filename: &str) -> io::Result<&mut Self>;
21  fn show(&mut self) -> io::Result<&mut Self>;
22  fn plot(&mut self,
23          xdata: &[f64],
24          ydata: &[f64],
25          label: &Option<String>,
26          color: &Option<String>,
27          marker: &Option<String>,
28          linestyle: &Option<String>,
29          linewidth: &Option<f64>)
30          -> io::Result<&mut Self>;
31  fn scatter(&mut self,
32             xdata: &[f64],
33             ydata: &[f64],
34             label: &Option<String>,
35             color: &Option<String>,
36             marker: &Option<String>)
37             -> io::Result<&mut Self>;
38  fn fill_between(&mut self,
39                  x: &[f64],
40                  y1: &[f64],
41                  y2: &[f64],
42                  where_: &Option<&[bool]>,
43                  interpolate: bool,
44                  step: &Option<String>)
45                  -> io::Result<&mut Self>;
46}