Open
Description
Describe the bug
At least with the CanvasBackend
the drawing of the axis seems to be off a little. Some lines of the axis don't quite connect. Some overlap which looks bad with the default opacity of the line.
It seems like the thickness of the line is not taken into consideration when drawing.
Overlap:
Overlap and end of X-Axis a little too short:
Axis not quite connecting right at 0:
Top of Y-Axis not going all the way to the top
To Reproduce
let backend = CanvasBackend::new("canvas").unwrap();
let root = backend.into_drawing_area();
root.fill(&WHITE).unwrap();
let mut chart = ChartBuilder::on(&root)
.set_left_and_bottom_label_area_size(30)
.margin(10)
.build_ranged(0.0..2.0, 0.0..3.0)
.unwrap();
chart
.configure_mesh()
.x_labels(3)
.y_labels(2)
.draw()
.unwrap();
let data = (0..=20)
.map(|x| x as f64 / 10.0)
.map(|x| (x, x.powf(2.0) + 1.0));
chart.draw_series(
AreaSeries::new(
data.clone(),
0.0,
&RED.mix(0.2),
)
.border_style(&RED),
).unwrap();
chart.draw_series(
data
.map(|(x, y)| Circle::new((x, y), 3, BLUE.filled())),
).unwrap();
root.present().unwrap();
Version Information
plotters = "0.2"