add_annotations

0th

Percentile

Add an annotation(s) to a plot

Add an annotation(s) to a plot

Usage
add_annotations(p, text = NULL, ..., data = NULL, inherit = TRUE)
Arguments
p

a plotly object

text

annotation text (required).

...

these arguments are documented at https://plot.ly/r/reference/#layout-annotations

data

a data frame.

inherit

inherit attributes from plot_ly()?

Aliases
  • add_annotations
Examples
library(plotly) # NOT RUN { # single annotation plot_ly(mtcars, x = ~wt, y = ~mpg) %>% slice(which.max(mpg)) %>% add_annotations(text = "Good mileage") # multiple annotations plot_ly(mtcars, x = ~wt, y = ~mpg) %>% filter(gear == 5) %>% add_annotations("five cylinder", ax = 40) # }
Documentation reproduced from package plotly, version 4.5.2, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.