Struct maelstrom_plot::AxisHints
source · pub struct AxisHints { /* private fields */ }
Expand description
Axis configuration.
Used to configure axis label and ticks.
Implementations§
source§impl AxisHints
impl AxisHints
sourcepub fn formatter(
self,
fmt: impl Fn(f64, usize, &RangeInclusive<f64>) -> String + 'static
) -> Self
pub fn formatter( self, fmt: impl Fn(f64, usize, &RangeInclusive<f64>) -> String + 'static ) -> Self
Specify custom formatter for ticks.
The first parameter of formatter
is the raw tick value as f64
.
The second parameter is the maximum number of characters that fit into y-labels.
The second parameter of formatter
is the currently shown range on this axis.
sourcepub fn label(self, label: impl Into<WidgetText>) -> Self
pub fn label(self, label: impl Into<WidgetText>) -> Self
Specify axis label.
The default is ‘x’ for x-axes and ‘y’ for y-axes.
sourcepub fn max_digits(self, digits: usize) -> Self
pub fn max_digits(self, digits: usize) -> Self
Specify maximum number of digits for ticks.
This is considered by the default tick formatter and affects the width of the y-axis
sourcepub fn placement(self, placement: impl Into<Placement>) -> Self
pub fn placement(self, placement: impl Into<Placement>) -> Self
Specify the placement of the axis.
For X-axis, use VPlacement
.
For Y-axis, use HPlacement
.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AxisHints
impl !Send for AxisHints
impl !Sync for AxisHints
impl Unpin for AxisHints
impl !UnwindSafe for AxisHints
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