pub struct Annotation {
pub text: String,
pub xy: (f64, f64),
pub xytext: (f64, f64),
pub fontsize: Option<f64>,
pub color: Option<Color>,
pub ha: HAlign,
pub va: VAlign,
pub arrowstyle: ArrowStyle,
pub arrow_color: Option<Color>,
}Expand description
An annotation with optional arrow from a text position to a data point.
Created by [Axes::annotate]. The text is drawn at xytext and, when an
arrow style other than ArrowStyle::None is set, an arrow is drawn from
xytext to xy.
Fields§
§text: StringThe annotation text string.
xy: (f64, f64)The data-space point being annotated.
xytext: (f64, f64)The data-space position where the text is placed.
fontsize: Option<f64>Optional font size override (in points). None uses the theme default.
color: Option<Color>Optional text color override. None uses the theme text color.
ha: HAlignHorizontal alignment of the text relative to xytext.
va: VAlignVertical alignment of the text relative to xytext.
arrowstyle: ArrowStyleThe style of arrow drawn from xytext to xy.
arrow_color: Option<Color>Optional arrow color override. None uses the text color.
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn arrowstyle(&mut self, style: ArrowStyle) -> &mut Self
pub fn arrowstyle(&mut self, style: ArrowStyle) -> &mut Self
Sets the arrow style.
Sourcepub fn arrow_color(&mut self, color: Color) -> &mut Self
pub fn arrow_color(&mut self, color: Color) -> &mut Self
Sets the arrow color.
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
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