pub struct Series3D<'a> { /* private fields */ }Expand description
One named 3D data set. Build it with Series3D::line, Series3D::scatter,
Series3D::bars, Series3D::surface, or Series3D::surface_fn, then add it
to a super::Plot3D.
Implementations§
Source§impl<'a> Series3D<'a>
impl<'a> Series3D<'a>
Sourcepub fn line(
name: impl Into<String>,
data: impl Into<Cow<'a, [[f64; 3]]>>,
) -> Self
pub fn line( name: impl Into<String>, data: impl Into<Cow<'a, [[f64; 3]]>>, ) -> Self
A polyline through [x, y, z] points, in order.
Sourcepub fn scatter(
name: impl Into<String>,
data: impl Into<Cow<'a, [[f64; 3]]>>,
) -> Self
pub fn scatter( name: impl Into<String>, data: impl Into<Cow<'a, [[f64; 3]]>>, ) -> Self
Unconnected 3D markers.
Sourcepub fn bars(
name: impl Into<String>,
data: impl Into<Cow<'a, [[f64; 3]]>>,
) -> Self
pub fn bars( name: impl Into<String>, data: impl Into<Cow<'a, [[f64; 3]]>>, ) -> Self
Vertical bars from the z base (0 by default) to each [x, y, z] point.
Sourcepub fn surface(
name: impl Into<String>,
x: impl Into<Cow<'a, [f64]>>,
y: impl Into<Cow<'a, [f64]>>,
z: impl Into<Cow<'a, [f64]>>,
) -> Self
pub fn surface( name: impl Into<String>, x: impl Into<Cow<'a, [f64]>>, y: impl Into<Cow<'a, [f64]>>, z: impl Into<Cow<'a, [f64]>>, ) -> Self
A surface over the grid x × y with row-major z.
let x = vec![-1.0, 0.0, 1.0];
let y = vec![-1.0, 0.0, 1.0];
let z = vec![0.0, 1.0, 0.0, 1.0, 2.0, 1.0, 0.0, 1.0, 0.0];
let mut state = Plot3DState::default();
Plot3D::new("terrain")
.series(Series3D::surface("terrain", x.clone(), y.clone(), z.clone()))
.show(ui, &mut icons, &mut state);Sourcepub fn surface_fn(
name: impl Into<String>,
x_range: RangeInclusive<f64>,
y_range: RangeInclusive<f64>,
samples: [usize; 2],
f: impl Fn(f64, f64) -> f64,
) -> Series3D<'static>
pub fn surface_fn( name: impl Into<String>, x_range: RangeInclusive<f64>, y_range: RangeInclusive<f64>, samples: [usize; 2], f: impl Fn(f64, f64) -> f64, ) -> Series3D<'static>
A surface sampled columns × rows times over two ranges.
Sourcepub fn color(self, color: Color32) -> Self
pub fn color(self, color: Color32) -> Self
Explicit color; the theme palette is used in order otherwise.
Sourcepub fn marker(self, marker: Marker) -> Self
pub fn marker(self, marker: Marker) -> Self
A marker on every line vertex, or the scatter marker.
Sourcepub fn bar_width(self, width: f64) -> Self
pub fn bar_width(self, width: f64) -> Self
Bar footprint in data units; the smallest x/y gap × 0.7 when None.
Sourcepub fn hide_from_legend(self) -> Self
pub fn hide_from_legend(self) -> Self
Leave the series out of the legend.
Sourcepub fn data(&self) -> &[[f64; 3]]
pub fn data(&self) -> &[[f64; 3]]
The points, for line, scatter, and bar series (empty for surfaces).
Sourcepub fn surface_grid(&self) -> Option<&Surface<'a>>
pub fn surface_grid(&self) -> Option<&Surface<'a>>
The surface grid, when this is a surface series.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Series3D<'a>
impl<'a> Freeze for Series3D<'a>
impl<'a> Move for Series3D<'a>
impl<'a> RefUnwindSafe for Series3D<'a>
impl<'a> Send for Series3D<'a>
impl<'a> Sync for Series3D<'a>
impl<'a> Unpin for Series3D<'a>
impl<'a> UnsafeUnpin for Series3D<'a>where
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'a [[f64; 3]]: UnsafeUnpin,
Vec<[f64; 3]>: UnsafeUnpin,
&'a [f64]: UnsafeUnpin,
Vec<f64>: UnsafeUnpin,
impl<'a> UnwindSafe for Series3D<'a>where
RawVecInner: UnwindSafe,
&'a [[f64; 3]]: UnwindSafe,
Vec<[f64; 3]>: UnwindSafe,
&'a [f64]: UnwindSafe,
Vec<f64>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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