Browse Source

Removed old code that I was using as reference

master
Julio Biason 2 years ago
parent
commit
3d236113ef
  1. 42
      plotterstest/src/main.rs

42
plotterstest/src/main.rs

@ -173,7 +173,7 @@ fn main() {
.unwrap();
let pos = Pos::new(HPos::Left, VPos::Bottom);
let x_label_style = TextStyle::from(("sans-serif", 9).into_font())
let x_label_style = TextStyle::from(("Ubuntu Medium", 10).into_font())
.pos(pos)
.transform(FontTransform::Rotate90);
chart
@ -217,43 +217,3 @@ fn main() {
root.present().unwrap();
}
// use plotters::prelude::*;
// const OUT_FILE_NAME: &'static str = "histogram.png";
// fn main() -> Result<(), Box<dyn std::error::Error>> {
// let root = BitMapBackend::new(OUT_FILE_NAME, (640, 480)).into_drawing_area();
// root.fill(&WHITE)?;
// let mut chart = ChartBuilder::on(&root)
// .x_label_area_size(35)
// .y_label_area_size(40)
// .margin(5)
// .caption("Histogram Test", ("sans-serif", 50.0))
// .build_cartesian_2d((0u32..10u32).into_segmented(), 0u32..10u32)?;
// chart
// .configure_mesh()
// .disable_x_mesh()
// .bold_line_style(&WHITE.mix(0.3))
// .y_desc("Time(secs)")
// .x_desc("Case")
// .axis_desc_style(("sans-serif", 15))
// .draw()?;
// let data = [
// 0u32, 1, 1, 1, 4, 2, 5, 7, 8, 6, 4, 2, 1, 8, 3, 3, 3, 4, 4, 3, 3, 3,
// ];
// chart.draw_series(
// Histogram::vertical(&chart)
// .style(RED.mix(0.5).filled())
// .data(data.iter().map(|x: &u32| (*x, 1))),
// )?;
// // To avoid the IO failure being ignored silently, we manually call the present function
// root.present().expect("Unable to write result to file, please make sure 'plotters-doc-data' dir exists under current dir");
// println!("Result has been saved to {}", OUT_FILE_NAME);
// Ok(())
// }

Loading…
Cancel
Save