pub struct Domain { /* private fields */ }Expand description
Data domain in two dimensions
The scales are:
X, abscissa (horizontal)Y, ordinate (vertical)
Implementations§
Source§impl Domain
impl Domain
Sourcepub fn including<P>(self, data: &[P]) -> Selfwhere
P: IntoPoint,
pub fn including<P>(self, data: &[P]) -> Selfwhere
P: IntoPoint,
Adjust domain to include a set of points
Examples found in repository?
examples/line.rs (line 9)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
fn main() {
let data_a = vec![(13, 74), (111, 37), (125, 52), (190, 66)];
let data_b = vec![(22, 50), (105, 44), (120, 67), (180, 39), (210, 43)];
let page = Page::new().chart(
Chart::new()
.title("Line Plot")
.domain(Domain::from(&data_a[..]).including(&data_b))
.axis("X Axis", Edge::Bottom)
.axis("Y Axis", Edge::Left)
.axis("", Edge::Right)
.plot(Plot::line("Series A", &data_a).label())
.plot(Plot::line("Series B", &data_b)),
);
print!("{page}");
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Domain
impl RefUnwindSafe for Domain
impl Send for Domain
impl Sync for Domain
impl Unpin for Domain
impl UnwindSafe for Domain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more