pub struct Axis {Show 15 fields
pub name: Arc<String>,
pub min_val: f64,
pub max_val: f64,
pub scale_mode: ScaleMode,
pub incr_sign: f64,
pub range: f64,
pub screen_origin: f32,
pub screen_range: f32,
pub screen_limit: f32,
pub detents: Vec<(f32, String)>,
pub draw_log_clip_warning: bool,
pub zoomed_range: Option<(f64, f64)>,
pub axis_label: Option<String>,
pub axis_formatter: Option<Box<FormatterFn>>,
pub alignment_mode: AxisAlignmentMode,
}
Fields§
§name: Arc<String>
§min_val: f64
Minimum detected value of this axis in data-coordinates
max_val: f64
Maximum detected value of this axis in data-coordinates
scale_mode: ScaleMode
Scaling mode for this axis
incr_sign: f64
-1 or +1, the direction of “positive” on this axis.
range: f64
The range of this axis (max - min values) in data-coordinates
screen_origin: f32
The origin (zero value) of this axis in screen coordinates
screen_range: f32
The range of this axis in screen coordinates
screen_limit: f32
The limit (max value) of this axis in screen coordinates
detents: Vec<(f32, String)>
The list of detents to draw on this axis, position and label
draw_log_clip_warning: bool
Whether or not to draw a warning that the values have been clipped to
positive values for log
drawing
zoomed_range: Option<(f64, f64)>
If the plot has been zoomed in, this is the (min,max) values in data coordinates of the changed range.
axis_label: Option<String>
Optional label to paint on this axis
axis_formatter: Option<Box<FormatterFn>>
Optional formatter for the detents on this axis, accepts the data value and returns a string as the detent.
alignment_mode: AxisAlignmentMode
Implementations§
Source§impl Axis
impl Axis
pub fn update_range<F: Fn(&PlotPoint) -> f64>( &mut self, vals: &[PlotPoint], accessor: F, opposite_axis: Option<&Axis>, )
pub fn linear_scale(&self, val: f64) -> f32
pub fn linear_unscale(&self, val: f32) -> f64
pub fn log_scale(&self, val: f64) -> f64
pub fn log_unscale(&self, val: f64) -> f64
pub fn db_scale(&self, val: f64) -> f64
pub fn db_unscale(&self, val: f64) -> f64
pub fn scale_value(&self, val: f64) -> Option<f32>
pub fn unscale_value(&self, val: f32) -> f64
pub fn model_to_screen(&self, val: f64) -> f32
pub fn screen_to_model(&self, val: f32) -> f64
pub fn describe_screen_pos(&self, val: f32) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Axis
impl !RefUnwindSafe for Axis
impl Send for Axis
impl !Sync for Axis
impl Unpin for Axis
impl !UnwindSafe for Axis
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> 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 more