use plt::*; fn main() { let xs: Vec = (0..=100).map(|n: u32| n as f64 * 0.1).collect(); let ys: Vec = xs.iter().map(|x| x.powi(3)).collect(); // create subplot let mut subplot = Subplot::builder() .label(Axes::X, "x data") .label(Axes::Y, "y data") .build(); // plot data subplot.plot(&xs, &ys).unwrap(); // make figure and add subplot let mut fig =
::default(); fig.set_layout(SingleLayout::new(subplot)).unwrap(); // save figure to file fig.draw_file(FileFormat::Png, "example.png").unwrap(); }