Struct pgfplots::axis::plot::coordinate::Coordinate2D
source · #[non_exhaustive]pub struct Coordinate2D {
pub x: f64,
pub y: f64,
pub error_x: Option<f64>,
pub error_y: Option<f64>,
}
Expand description
Coordinate in a two-dimensional plot.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.x: f64
§y: f64
§error_x: Option<f64>
By default, error bars are not drawn (even if it is a Some
). These
are only drawn if both PlotKey::XError
and
PlotKey::XErrorDirection
are set in the Plot2D
.
error_y: Option<f64>
By default, error bars are not drawn (even if it is a Some
). These
are only drawn if both PlotKey::YError
and
PlotKey::YErrorDirection
are set in the Plot2D
.
Trait Implementations§
source§impl Clone for Coordinate2D
impl Clone for Coordinate2D
source§fn clone(&self) -> Coordinate2D
fn clone(&self) -> Coordinate2D
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Coordinate2D
impl Debug for Coordinate2D
source§impl Display for Coordinate2D
impl Display for Coordinate2D
source§impl From<(f64, f64, Option<f64>, Option<f64>)> for Coordinate2D
impl From<(f64, f64, Option<f64>, Option<f64>)> for Coordinate2D
source§fn from(coordinate: (f64, f64, Option<f64>, Option<f64>)) -> Self
fn from(coordinate: (f64, f64, Option<f64>, Option<f64>)) -> Self
Conversion from an (x,y,error_x,error_y)
tuple into a two-dimensional
coordinate.
Examples
use pgfplots::axis::plot::coordinate::Coordinate2D;
let point: Coordinate2D = (1.0, -1.0, None, Some(3.0)).into();
assert_eq!(point.x, 1.0);
assert_eq!(point.y, -1.0);
assert!(point.error_x.is_none());
assert_eq!(point.error_y.unwrap(), 3.0);
source§impl From<(f64, f64)> for Coordinate2D
impl From<(f64, f64)> for Coordinate2D
source§fn from(coordinate: (f64, f64)) -> Self
fn from(coordinate: (f64, f64)) -> Self
Conversion from an (x,y)
tuple into a two-dimensional coordinate.
Examples
use pgfplots::axis::plot::coordinate::Coordinate2D;
let point: Coordinate2D = (1.0, -1.0).into();
assert_eq!(point.x, 1.0);
assert_eq!(point.y, -1.0);
assert!(point.error_x.is_none());
assert!(point.error_y.is_none());