Trait plotters::coord::combinators::BindKeyPoints
source · [−]pub trait BindKeyPoints where
Self: AsRangedCoord, {
fn with_key_points(
self,
points: Vec<Self::Value>
) -> WithKeyPoints<Self::CoordDescType> { ... }
}
Expand description
Bind a existing coordinate spec with a given key points vector. See WithKeyPoints for more details.
Provided Methods
fn with_key_points(
self,
points: Vec<Self::Value>
) -> WithKeyPoints<Self::CoordDescType>
fn with_key_points(
self,
points: Vec<Self::Value>
) -> WithKeyPoints<Self::CoordDescType>
Bind a existing coordinate spec with a given key points vector. See WithKeyPoints for more details. Example:
use plotters::prelude::*;
use plotters_bitmap::BitMapBackend;
let mut buffer = vec![0;1024*768*3];
let root = BitMapBackend::with_buffer(&mut buffer, (1024, 768)).into_drawing_area();
let mut chart = ChartBuilder::on(&root)
.build_cartesian_2d(
(0..100).with_key_points(vec![1,20,50,90]), // <= This line will make the plot shows 4 tick marks at 1, 20, 50, 90
0..10
).unwrap();
chart.configure_mesh().draw().unwrap();