pub struct PositionDodge {
pub width: Option<f64>,
pub reverse: bool,
}Expand description
Place groups side-by-side (ggplot2’s position_dodge(width)).
Within each x position the groups present there (group / fill / colour
level, in first-appearance order — the legend order — or reversed with
with_reverse) share width (in x units; one
category on a discrete axis) and are centred on x:
offset = (k − (n − 1)/2) · width / n for the k-th of n groups. On a
continuous axis x itself moves; on a discrete axis the offset is stored in
the .x_dodge_offset column and applied by the geoms that support it
(point, pointrange, errorbar, linerange, ribbon, censor marks), so several
models’ intervals per term sit side by side — also under coord_flip.
PositionDodge is also usable as a value (the default, width from the
layer, 0.9), as before 0.17.
Fields§
§width: Option<f64>Total dodge width; None = the layer default (0.9).
reverse: boolReverse the group order (ggplot2 ≥ 3.5 reverse = TRUE).
Implementations§
Source§impl PositionDodge
impl PositionDodge
Trait Implementations§
Source§impl Clone for PositionDodge
impl Clone for PositionDodge
Source§impl Debug for PositionDodge
impl Debug for PositionDodge
Source§impl Default for PositionDodge
impl Default for PositionDodge
Source§impl PartialEq for PositionDodge
impl PartialEq for PositionDodge
Source§impl Position for PositionDodge
impl Position for PositionDodge
Source§fn per_panel(&self) -> bool
fn per_panel(&self) -> bool
ggplot2 computes position_dodge’s group count/offset per facet
panel (compute_panel), not pooled across panels (#153) — verified
against ggplot2 4.0.3: a group missing from one panel’s x level
doesn’t shift the groups that panel does have.
Source§fn group_order(&self, data: &DataFrame) -> Option<Vec<String>>
fn group_order(&self, data: &DataFrame) -> Option<Vec<String>>
Review #167 finding 2: the group rank still comes from the whole
layer (first-appearance order across every panel), even though the
per-x group count stays per-panel. Without this, a panel whose
rows happen to list groups in a different order than another panel
drew that group on the opposite side — a regression vs 0.22.2 and
ggplot2 4.0.3, which both rank by the global group id.
Source§fn compute(&self, data: &mut DataFrame, params: &PositionParams)
fn compute(&self, data: &mut DataFrame, params: &PositionParams)
fn name(&self) -> &str
impl StructuralPartialEq for PositionDodge
Auto Trait Implementations§
impl Freeze for PositionDodge
impl RefUnwindSafe for PositionDodge
impl Send for PositionDodge
impl Sync for PositionDodge
impl Unpin for PositionDodge
impl UnsafeUnpin for PositionDodge
impl UnwindSafe for PositionDodge
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