Describe the bug
I was trying to use with_key_points to manually set the ticks of my x-axis, but I couldn't get it to compile when using floats. As far as I know, it works great when the axis uses integers, but when using floats it causes configure_mesh to not compile (cf below).
Looks like someone else ran into this issue here and also someone on reddit.
Would love to help but not sure I am good enough at rust
To Reproduce
let drawing_area = BitMapBackend::new("./test.png", (640, 480)).into_drawing_area();
let mut plot = ChartBuilder::on(&drawing_area)
.build_cartesian_2d((0f32..3.5f32).with_key_points(vec![1f32, 2f32]), 0..10)
.unwrap();
plot.configure_mesh().draw().unwrap(); // <-- does not compile
the compilor error is:
- the method
configure_mesh exists for struct ChartContext<'_, BitMapBackend<'_>, Cartesian2d<..., _>> , but its trait bounds were not satisfied
the following trait bounds were not satisfied:
<WithKeyPoints<RangedCoordf32> as Ranged>::FormatOption = DefaultFormatting
which is required by WithKeyPoints<RangedCoordf32>: ValueFormatter<f32>
Version Information
plotters 0.3.7
(thanks for the work on plotters!)
Describe the bug
I was trying to use
with_key_pointsto manually set the ticks of my x-axis, but I couldn't get it to compile when using floats. As far as I know, it works great when the axis uses integers, but when using floats it causes configure_mesh to not compile (cf below).Looks like someone else ran into this issue here and also someone on reddit.
Would love to help but not sure I am good enough at rust
To Reproduce
the compilor error is:
Version Information
plotters 0.3.7
(thanks for the work on plotters!)