pub enum IntensityMode {
Vertex,
Cell,
}Expand description
An enumeration representing the source of intensity values for mesh coloring.
The IntensityMode enum specifies whether intensity values should be taken
from vertices or cells (faces) of a 3D mesh.
§Example
use plotlars::{ColorBar, IntensityMode, Mesh3D, Palette, Plot};
use polars::prelude::*;
// Create sample mesh data with intensity values
let x = vec![0.0, 1.0, 2.0, 0.0];
let y = vec![0.0, 0.0, 1.0, 2.0];
let z = vec![0.0, 2.0, 0.0, 1.0];
let intensity = vec![0.0, 0.5, 0.8, 1.0];
let dataset = DataFrame::new(vec![
Column::new("x".into(), x),
Column::new("y".into(), y),
Column::new("z".into(), z),
Column::new("intensity".into(), intensity),
])
.unwrap();
Mesh3D::builder()
.data(&dataset)
.x("x")
.y("y")
.z("z")
.intensity("intensity")
.intensity_mode(IntensityMode::Vertex)
.color_scale(Palette::Viridis)
.color_bar(
&ColorBar::new()
.x(0.65) // Position color bar extremely close to the plot
)
.build()
.plot();
Variants§
Trait Implementations§
Source§impl Clone for IntensityMode
impl Clone for IntensityMode
Source§fn clone(&self) -> IntensityMode
fn clone(&self) -> IntensityMode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for IntensityMode
Auto Trait Implementations§
impl Freeze for IntensityMode
impl RefUnwindSafe for IntensityMode
impl Send for IntensityMode
impl Sync for IntensityMode
impl Unpin for IntensityMode
impl UnwindSafe for IntensityMode
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