pub enum Fill {
ToZeroY,
ToZeroX,
ToNextY,
ToNextX,
ToSelf,
ToNext,
None,
}Expand description
An enumeration representing different fill modes for area traces in plots.
The Fill enum specifies how the area under or between traces should be filled
in plots like scatter plots, line plots, and polar scatter plots.
§Example
use plotlars::{Fill, Mode, Plot, Rgb, ScatterPolar, Text};
use polars::prelude::*;
let angles: Vec<f64> = (0..=360).step_by(10).map(|x| x as f64).collect();
let radii: Vec<f64> = angles.iter()
.map(|&angle| 5.0 + 3.0 * (angle * std::f64::consts::PI / 180.0).sin())
.collect();
let dataset = DataFrame::new(vec![
Column::new("angle".into(), angles),
Column::new("radius".into(), radii),
])
.unwrap();
ScatterPolar::builder()
.data(&dataset)
.theta("angle")
.r("radius")
.mode(Mode::Lines)
.fill(Fill::ToSelf) // Fill the area enclosed by the trace
.color(Rgb(135, 206, 250))
.opacity(0.6)
.plot_title(Text::from("Filled Polar Area Chart"))
.build()
.plot();
Variants§
ToZeroY
Fill area from the trace to y=0 (horizontal axis)
ToZeroX
Fill area from the trace to x=0 (vertical axis)
ToNextY
Fill area between this trace and the next trace along the y-direction
ToNextX
Fill area between this trace and the next trace along the x-direction
ToSelf
Fill the area enclosed by the trace (connecting the last point to the first)
ToNext
Fill area between this trace and the next trace
None
Do not fill any area
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fill
impl RefUnwindSafe for Fill
impl Send for Fill
impl Sync for Fill
impl Unpin for Fill
impl UnwindSafe for Fill
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