Show Sidebar Hide Sidebar

Configuration Options in R

How to set configuration options of plotly graphs in python. Examples of both online and offline configurations.

New to Plotly?

Plotly's R library is free and open source!
Get started by downloading the client and reading the primer.
You can set up Plotly to work in online or offline mode.
We also have a quick-reference cheatsheet (new!) to help you get started!

Version Check

Version 4 of Plotly's R package is now available!
Check out this post for more information on breaking changes and new features available in this version.

## [1] ''

Online Configuration Options

Config options set via our API libraries are overridden on graphs hosted on (i.e. when working online). To set configutation options online, you can edit the plot's embed url. Visit our embed tutorial: click here for more information on customizing the embed url to remove the "Edit Chart" link, hide the modebar, or autosize the plot.

Offline Configuration Options

Add the 'Edit Chart' link:

p <- plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length)

htmlwidgets::saveWidget(config(p, showLink = T), "graph.html")

Remove the 'collaborate mode bar button':

htmlwidgets::saveWidget(config(p, collaborate = FALSE), "graph.html")

Remove the 'mode bar':

htmlwidgets::saveWidget(config(p, displayModeBar = FALSE), "graph.html")


Arguments are documented here.