diff --git a/plotters/examples/histogram.rs b/plotters/examples/histogram.rs index a56ce026..50cc360a 100644 --- a/plotters/examples/histogram.rs +++ b/plotters/examples/histogram.rs @@ -28,7 +28,7 @@ fn main() -> Result<(), Box> { chart.draw_series( Histogram::vertical(&chart) .style(RED.mix(0.5).filled()) - .data(data.iter().map(|x: &u32| (*x, 1))), + .data(data.iter().enumerate().map(|(x, &y)| (x, y))), )?; // To avoid the IO failure being ignored silently, we manually call the present function