Open Pierstoval opened 1 year ago
I managed to fix this by converting the entirety of all my graphs' Y coordinates to f32
instead of i32
, but it's really bothersome and I definitely wish there were a solution to allow i32 to be used.
Boxplot support only f32 coordinates. You can see the values of quartiles are converted to f32 by the Quartiles.values() method. Perhaps it's a typo from boxplot developer. https://docs.rs/plotters/latest/src/plotters/data/quartiles.rs.html#3-9
f64 is preferred because the quartiles struct is defined on f64:
Hello, rookie Rustacean here.
Using latest Plotters version as of today (0.3.5), I got this kind of code where I want to draw a single boxplot on an existing chart:
However I encounter this error:
Turns out Boxplot's default Y-axis implementation requires f32, but my entire graph only uses integers, especially i32 ones.
How can I mitigate this? Is it a type error on the Boxplot side that requires change?
If you want to reproduce:
The actual code is here. Clone the repo, run
git checkout 38efc8791068c
(it's the actual HEAD but it's to be sure to checkout the proper commit in case I have to work on something else in the meantime).Then run
cargo run --manifest-path=graphs/Cargo.toml -- vps
from the root of the repo.List of commands:
Should do the trick to reproduce the issue