pub enum Annotation {
Text {
label: String,
x: f64,
y: f64,
size: f64,
color: (u8, u8, u8),
},
Rect {
xmin: f64,
xmax: f64,
ymin: f64,
ymax: f64,
fill: (u8, u8, u8),
alpha: f64,
},
Segment {
x: f64,
y: f64,
xend: f64,
yend: f64,
color: (u8, u8, u8),
width: f64,
},
LogTicks {
sides: String,
outside: bool,
lengths: (f64, f64, f64),
color: (u8, u8, u8),
width: f64,
},
Raster {
image: Arc<Vec<u8>>,
xmin: f64,
xmax: f64,
ymin: f64,
ymax: f64,
alpha: f64,
},
Inset {
plot: InsetPlot,
xmin: f64,
xmax: f64,
ymin: f64,
ymax: f64,
},
}Expand description
Annotation types for adding static marks to a plot.
Variants§
Text
Text annotation at a data position.
Rect
Rectangle annotation between two data positions.
Segment
Line segment annotation between two data positions.
LogTicks
Log-10 tick marks on panel edges (ggplot2’s annotation_logticks):
long ticks at each power of ten, mid at 5×, short at 2–4× and 6–9×.
Positions are read in the axis’ (log10-)transformed units, so it suits
scale_x_log10() / scale_y_log10() or data already in log10.
Fields
Raster
An encoded image (PNG or JPEG bytes) stretched over a data rectangle
(ggplot2’s annotation_raster). ±INFINITY bounds mean the panel edge.
Inset
A whole plot drawn into a data rectangle (ggplot2’s annotation_custom
with a ggplot grob — an inset). ±INFINITY bounds mean the panel edge.
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn outside(self) -> Self
pub fn outside(self) -> Self
outside = TRUE for Annotation::LogTicks (no-op otherwise).
Sourcepub fn raster(
image: Vec<u8>,
xmin: f64,
xmax: f64,
ymin: f64,
ymax: f64,
) -> Self
pub fn raster( image: Vec<u8>, xmin: f64, xmax: f64, ymin: f64, ymax: f64, ) -> Self
An encoded PNG / JPEG image over the data rectangle.
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Auto 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
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