Skip to content

Commit 57ae178

Browse files
authored
Fix: histogram data draw
1 parent 3ad52da commit 57ae178

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plotters/examples/histogram.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2828
chart.draw_series(
2929
Histogram::vertical(&chart)
3030
.style(RED.mix(0.5).filled())
31-
.data(data.iter().map(|x: &u32| (*x, 1))),
31+
.data(data.iter().enumerate().map(|(x, &y)| (x, y))),
3232
)?;
3333

3434
// To avoid the IO failure being ignored silently, we manually call the present function

0 commit comments

Comments
 (0)