add_labels {easylabel} | R Documentation |
Add labels to a plotly scatter plot
Description
Adds labels to a plotly 2d or 3d scatter plot. The labels can be dragged.
Usage
add_labels(p, labs, plotGlPixelRatio = 8)
Arguments
p |
A plotly scatter plot object |
labs |
Character vector of labels to match |
plotGlPixelRatio |
Integer passed to plotly.js config which controls pixel resolution of webGl rendering. Larger values increase resolution of points as well as file size. |
Details
Labels are identified by searching the rownames of the embedded marker data within the plotly object. The plotly mode bar camera icon is set to export to svg by default.
Value
A plotly plot with added labels
Examples
library(plotly)
data(mtcars)
p <- plot_ly(mtcars, x = ~mpg, y = ~wt, color = ~cyl,
type = 'scatter', mode = 'markers')
p %>% add_labels(c("Mazda RX4", "Fiat 128"))
[Package easylabel version 0.3.3 Index]