diff --git a/examples/example_sine.rs b/examples/example_sine.rs index 7ab0e1a..45da5b8 100644 --- a/examples/example_sine.rs +++ b/examples/example_sine.rs @@ -79,20 +79,18 @@ fn main() -> Result<(), Box> { .draw()?; // add the first plot - let mut data1: Vec<(f64,f64)> = x_test.iter().zip(y_test_true.iter()) + let data1: Vec<(f64,f64)> = x_test.iter().zip(y_test_true.iter()) .map(|(x, y)| (x[0], y[0])) .collect(); - data1.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); chart .draw_series(LineSeries::new(data1, &RED)).unwrap() .label("true values") .legend(|(x, y)| PathElement::new(vec![(x, y), (x + 1, y)], &RED)); // add the second plot - let mut data2: Vec<(f64,f64)> = x_test.iter().zip(y_test_pred.iter()) + let data2: Vec<(f64,f64)> = x_test.iter().zip(y_test_pred.iter()) .map(|(x, y)| (x[0], y[0])) .collect(); - data2.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); chart .draw_series(LineSeries::new(data2, &BLUE)).unwrap() .label("predicted values")