Closed Guelakais closed 7 months ago
Got it right, the code now looks like this:
use tagu::format_move;
use poloto::build;
use std::fs::write;
fn main() {
// hourly trend over one day.
let trend = vec![
2.83,
37.8,
0.25
];
let plots = poloto::plots!(
build::plot("").histogram((0..).zip(trend)),
build::markers([6], [])
);
let data = poloto::frame_build().data(plots);
write("plot.svg", data.map_xticks(|_| poloto::ticks::from_iter((0..).step_by(1)).with_tick_fmt(|&v| format_move!("{} hr", v)))
.build_and_label(("Runtime Comparision", "Runtime in sec", "Programming Language"))
.append_to(poloto::header().light_theme())
.render_string().unwrap()).unwrap();
}
Your tool is simply not self-explanatory. Is there a better way than the following to transfer a created plot directly into a file?
What would I have to change in the following example?