pub enum AxisType {
Default,
Linear,
Log,
Date,
Category,
MultiCategory,
}Expand description
Enumeration representing the type of the axis.
§Example
use polars::prelude::*;
use plotlars::{Axis, AxisType, LinePlot, Plot};
let linear_values = vec![
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
20, 30, 40, 50, 60, 70, 80, 90, 100,
200, 300, 400, 500, 600, 700, 800, 900, 1000
];
let logarithms = vec![
0.0000, 0.3010, 0.4771, 0.6021, 0.6990,
0.7782, 0.8451, 0.9031, 0.9542, 1.0000,
1.3010, 1.4771, 1.6021, 1.6990, 1.7782,
1.8451, 1.9031, 1.9542, 2.0000,
2.3010, 2.4771, 2.6021, 2.6990,
2.7782, 2.8451, 2.9031, 2.9542, 3.0000
];
let dataset = DataFrame::new(vec![
Column::new("linear_values".into(), linear_values),
Column::new("logarithms".into(), logarithms),
]).unwrap();
let axis = Axis::new()
.axis_type(AxisType::Log)
.show_line(true);
LinePlot::builder()
.data(&dataset)
.x("linear_values")
.y("logarithms")
.y_title("log₁₀ x")
.x_title("x")
.y_axis(&axis)
.x_axis(&axis)
.build()
.plot();
Variants§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AxisType
impl RefUnwindSafe for AxisType
impl Send for AxisType
impl Sync for AxisType
impl Unpin for AxisType
impl UnwindSafe for AxisType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more