style {plotly} | R Documentation

## Modify trace(s)

### Description

Modify trace(s) of an existing plotly visualization. Useful when used in conjunction with `get_figure()`.

### Usage

    style(p, ..., traces = NULL)

### Arguments

`p` | A plotly visualization.
`...` | Visual properties.
`traces` | numeric vector. Which traces should be modified? By default, attributes place in `...` will be applied to every trace.

### Author(s)

Carson Sievert

### See Also

`api_download_plot()`

### Examples

    p <- qplot(data = mtcars, wt, mpg, geom = c("point", "smooth"))
    # keep the hover info for points, but remove it for the line/ribbon
    style(p, hoverinfo = "none", traces = c(2, 3))

[Package plotly version 4.8.0 Index]