use std::f64::consts::TAU;
use rizzma::artist::Line2D;
use rizzma::core::color::Rgba;
use rizzma::figure::Figure;
fn main() {
let mut fig = Figure::new(6.0, 4.0);
let ax = fig.add_axes(0.12, 0.12, 0.8, 0.8);
let n = 200;
let xs: Vec<f64> = (0..n).map(|i| TAU * i as f64 / (n as f64 - 1.0)).collect();
let ys: Vec<f64> = xs.iter().map(|&x| x.sin()).collect();
let blue = Rgba::new(0.121_568_63, 0.466_666_67, 0.705_882_35, 1.0);
ax.add_line(Line2D::new(xs, ys).with_color(blue).with_linewidth(1.5));
ax.set_title("sin(x)");
ax.set_xlabel("x");
ax.set_ylabel("y");
let path = "target/line_plot.png";
fig.save_png(path).expect("save PNG");
println!("wrote {path}");
}