Skip to main content

plotlars_core/components/
tick.rs

1/// Enumeration representing the direction of axis ticks.
2///
3/// # Example
4///
5/// ```rust
6/// use polars::prelude::*;
7/// use plotlars::{Axis, Plot, ScatterPlot, TickDirection};
8///
9/// let x = vec![1];
10/// let y  = vec![1];
11///
12/// let dataset = DataFrame::new(x.len(), vec![
13///     Column::new("x".into(), x),
14///     Column::new("y".into(), y),
15/// ]).unwrap();
16///
17/// ScatterPlot::builder()
18///     .data(&dataset)
19///     .x("x")
20///     .y("y")
21///     .x_axis(
22///         &Axis::new()
23///             .tick_direction(TickDirection::OutSide)
24///     )
25///     .y_axis(
26///         &Axis::new()
27///             .tick_direction(TickDirection::InSide)
28///     )
29///     .build()
30///     .plot();
31/// ```
32///
33/// ![Example](https://imgur.com/9DSwJnx.png)
34#[derive(Clone)]
35pub enum TickDirection {
36    OutSide,
37    InSide,
38    None,
39}