use ruviz::core::Plot;
use ruviz::core::Position;
use ruviz::render::Theme;
fn main() -> std::result::Result<(), Box<dyn std::error::Error>> {
println!("🔍 Testing axis labels and legends...");
std::fs::create_dir_all("gallery/test")?;
let x_data: Vec<f64> = (0..100).map(|i| i as f64 * 0.1).collect();
let y1: Vec<f64> = x_data.iter().map(|&x| x.sin()).collect();
let y2: Vec<f64> = x_data.iter().map(|&x| (x * 1.5).cos()).collect();
println!("📊 Testing multi-series plot with legend...");
Plot::new()
.title("Axis Labels and Legend Test".to_string())
.xlabel("Time (seconds)".to_string())
.ylabel("Amplitude".to_string())
.theme(Theme::publication())
.line(&x_data, &y1) .line(&x_data, &y2) .legend(Position::TopRight) .save_with_size("gallery/basic/axis_legend_test.png", 1200, 900)?;
println!("✅ Axis and legend test completed!");
println!("📂 Check ./gallery/basic/axis_legend_test.png");
Ok(())
}