Description Usage Arguments Value Author(s) See Also Examples
View source: R/plotly_annotation_rm.R
Manage annotations of plotly
object.
1 2 3 4 5 6 7 | plotly_annotation_rm(obj, which = NULL)
plotly_annotation_list(obj, which = NULL)
plotly_annotation_n(obj)
plotly_annotation_text(obj)
|
obj |
a plotly object (created with function |
which |
Numeric vector with numbers of annotations to remove. |
The functions described here do the following actions to plotly
object:
plotly_annotation_rm
() removes annotations and returns
updated plotly
object;
plotly_annotation_n
() returns the number of annotations in the object;
plotly_annotation_list
() returns a list of annotation parameters;
plotly_annotation_text
() returns a list with text of each annotation.
Vilmantas Gegzna
Other spPlot functions for plotly:
label_expr2text()
,
plotly_modify_hover()
,
plotly_modify_legend()
,
plotly_tidy()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(spPlot)
library(plotly)
# Create plotly object 'obj':
iris$Species2 <- sample(iris$Species)
p <- ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width))
obj <- subplot(p + geom_line(aes(color = Species)),
p + geom_point(aes(shape = Species2)))
# Print the plot:
obj
# Get parameters of annotations:
plotly_annotation_list(obj)
plotly_annotation_n(obj)
plotly_annotation_text(obj)
# The same plot with all annotations removed:
plotly_annotation_rm(obj)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.