plotters
plotters copied to clipboard
[BUG] Overflow when using flipped segmented axes
Describe the bug
Got panic thread 'main' panicked at 'attempt to subtract with overflow', [...]\plotters-0.3.2\src\coord\ranged1d\discrete.rs:148:56 when trying to draw a graph with discrete axes and flipped y-axis. I expected to get the same result as when not using discrete axes, except with the labels centered and possibly an off-by one error somewhere.
To Reproduce
let root = BitMapBackend::new("test.png", (1024, 1024)).into_drawing_area();
let mut chart = ChartBuilder::on(&root)
.build_cartesian_2d((0..3).into_segmented(), (3..0).into_segmented())
.unwrap();
chart
.configure_mesh()
.draw()
.unwrap();
Version Information
0.3.2