From 346543aedf6fcb95fa2635450e16c6d7b26b4413 Mon Sep 17 00:00:00 2001 From: Olivier Giniaux Date: Sat, 9 Nov 2024 22:42:05 +0100 Subject: [PATCH] Trim y min on plot --- benches/throughput/result_processor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benches/throughput/result_processor.rs b/benches/throughput/result_processor.rs index 467ac7f..8963cbe 100644 --- a/benches/throughput/result_processor.rs +++ b/benches/throughput/result_processor.rs @@ -132,7 +132,7 @@ impl ResultProcessor for OutputPlot { let x_min = self.series.iter().next().unwrap().1.iter().map(|(x, _)| *x as u32).min().unwrap(); let x_max = self.series.iter().next().unwrap().1.iter().map(|(x, _)| *x as u32).max().unwrap(); - let y_min = 0u32; + let y_min = self.series.iter().flat_map(|inner_map| inner_map.1.iter()).map(|(_, y)| (0.95 * *y) as u32).min().unwrap(); let y_max = self.series.iter().flat_map(|inner_map| inner_map.1.iter()).map(|(_, y)| (1.05 * *y) as u32).max().unwrap(); let mut chart = ChartBuilder::on(&canvas)