pub struct PositionJitter {
pub width: Option<f64>,
pub height: Option<f64>,
pub seed: u64,
}Expand description
Add random noise to x and y positions to reduce overplotting.
Each value moves by a uniform amount in [-width, width) (x) and
[-height, height) (y). None (the default) means “40% of the data’s
resolution”, as in ggplot2: the smallest gap between distinct values, or 1
for integer/constant data — so integer-coded categories (1, 2, 3, …) get
±0.4 and finely-spaced continuous data gets proportionally small noise.
Some(0.0) disables jitter along that axis.
Fields§
§width: Option<f64>Horizontal jitter amount in data units; None = 0.4 × resolution(x).
height: Option<f64>Vertical jitter amount in data units; None = 0.4 × resolution(y).
seed: u64Seed of the deterministic noise stream.
Implementations§
Source§impl PositionJitter
impl PositionJitter
Sourcepub fn new(width: f64, height: f64) -> Self
pub fn new(width: f64, height: f64) -> Self
Explicit jitter amounts (data units), default seed.
Sourcepub fn with_width(self, width: f64) -> Self
pub fn with_width(self, width: f64) -> Self
Set the horizontal jitter amount (data units).
Sourcepub fn with_height(self, height: f64) -> Self
pub fn with_height(self, height: f64) -> Self
Set the vertical jitter amount (data units).
Trait Implementations§
Source§impl Clone for PositionJitter
impl Clone for PositionJitter
Source§impl Debug for PositionJitter
impl Debug for PositionJitter
Source§impl Default for PositionJitter
impl Default for PositionJitter
Auto Trait Implementations§
impl Freeze for PositionJitter
impl RefUnwindSafe for PositionJitter
impl Send for PositionJitter
impl Sync for PositionJitter
impl Unpin for PositionJitter
impl UnsafeUnpin for PositionJitter
impl UnwindSafe for PositionJitter
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
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> ⓘ
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 more