Closed 38 closed 5 years ago
Any idea how to inset chart axis and labels while its not implemented?
The fastest way, you may already know is draw it yourself. Since Plotters expose full drawing API to developer.
Things may be helpful to you is:
First, we can use this https://docs.rs/plotters/0.2.7/plotters/chart/struct.ChartContext.html#method.plotting_area To get the plotting area.
Then, you can use https://docs.rs/plotters/0.2.7/plotters/drawing/struct.DrawingArea.html#method.draw to draw anything you want on to it.
So the thing may looks like:
let mut chart ....;
let pda = chart.plotting_area();
let range: RangedCoordi32 = (0..100).into();
for y in range.key_points(5) {
// In here we get desired location for the tick marks.
pda.draw(.....);
}
Hopefully you can draw anything you want. Feel free to ask me if you have any question :)
In addition, please check this page on what element you can draw: https://docs.rs/plotters/0.2.7/plotters/element/index.html#structs
I have almost done this feature. Hope will PR soon...
Merged #50
See discuss under issue #31