use std::f64::consts::TAU;
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();
for k in 0..3 {
let phase = TAU * f64::from(k) / 3.0;
let ys: Vec<f64> = xs.iter().map(|&x| (x + phase).sin()).collect();
ax.plot(&xs, &ys);
}
ax.set_title("phase-shifted sines");
ax.set_xlabel("x");
ax.set_ylabel("y");
let path = "target/multi_line.png";
fig.save_png(path).expect("save PNG");
println!("wrote {path}");
}