pub struct MappedImageMut<'a> { /* private fields */ }Expand description
A handle to a colour-mapped image created by
mapped_image.
use ironlab::prelude::*;
let field = Matrix::from_fn(20, 30, |row, col| (row as f64 - 10.0) * (col as f64 - 15.0));
let mut fig = Figure::new();
fig.axes(0, 0)
.mapped_image(&field)
.plane(ImagePlane::Xz { y: Some(0.0) })
.below(Color::BLACK)
.above(Color::WHITE)
.non_finite(OutOfRange::Strict);Implementations§
Source§impl MappedImageMut<'_>
impl MappedImageMut<'_>
Sourcepub fn display_name(&mut self, name: impl Into<Text>) -> &mut Self
pub fn display_name(&mut self, name: impl Into<Text>) -> &mut Self
Sets the name shown for the image in the legend.
Sourcepub fn pixel_columns(&mut self, first: f64, last: f64) -> &mut Self
pub fn pixel_columns(&mut self, first: f64, last: f64) -> &mut Self
Places the centres of the first and last columns of the image at the
given coordinates along the first axis of its plane (MATLAB’s XData).
The pitch between centres follows from the number of columns, and the
image covers half a pitch beyond each centre; a last less than first
mirrors the image. Without a range the centres lie at 0, 1, …, n − 1.
The coordinates must be finite and may coincide only when the image has
one column, as Figure::validate checks.
Sourcepub fn pixel_rows(&mut self, first: f64, last: f64) -> &mut Self
pub fn pixel_rows(&mut self, first: f64, last: f64) -> &mut Self
Places the centres of the first and last rows of the image at the given
coordinates along the second axis of its plane (MATLAB’s YData), as
pixel_columns places the columns.
Row 0 of the pixels lies at first, so an image whose rows count down
from its top is placed the right way up by a first greater than last.
Sourcepub fn plane(&mut self, plane: ImagePlane) -> &mut Self
pub fn plane(&mut self, plane: ImagePlane) -> &mut Self
Sets the plane of the axes in which the image lies, with its offset along the third axis.
The xz and yz planes are the walls of a three-dimensional axes, so placing
the image in one of them converts a two-dimensional axes to three
dimensions with the default view, as surf does;
an axes that is already three-dimensional keeps its view. The xy plane
never changes the projection: it is the only plane of a two-dimensional
axes, which ignores its height, and the floor of a three-dimensional one.
Source§impl MappedImageMut<'_>
impl MappedImageMut<'_>
Sourcepub fn below(&mut self, policy: impl Into<OutOfRange>) -> &mut Self
pub fn below(&mut self, policy: impl Into<OutOfRange>) -> &mut Self
Sets what is drawn for a pixel whose value is less than the lower colour limit.
A Color gives the fixed-colour policy OutOfRange::Rgba.
OutOfRange::Strict makes such a pixel a validation error,
OutOfRange::Transparent, the default, draws nothing, and
OutOfRange::Clamp draws the first entry of the colormap.
Sourcepub fn above(&mut self, policy: impl Into<OutOfRange>) -> &mut Self
pub fn above(&mut self, policy: impl Into<OutOfRange>) -> &mut Self
Sets what is drawn for a pixel whose value is greater than the upper colour limit.
The policies are as for below, except that a clamp draws the
last entry of the colormap.
Sourcepub fn non_finite(&mut self, policy: impl Into<OutOfRange>) -> &mut Self
pub fn non_finite(&mut self, policy: impl Into<OutOfRange>) -> &mut Self
Sets what is drawn for a pixel whose value is NaN or infinite.
The policies are as for below, except that a clamp draws
nothing, because a non-finite value has no nearest end of the colormap.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for MappedImageMut<'a>
impl<'a> Freeze for MappedImageMut<'a>
impl<'a> RefUnwindSafe for MappedImageMut<'a>
impl<'a> Send for MappedImageMut<'a>
impl<'a> Sync for MappedImageMut<'a>
impl<'a> Unpin for MappedImageMut<'a>
impl<'a> UnsafeUnpin for MappedImageMut<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.