Black Lives Matter. Please consider donating to Black Girls Code today.

Configuration Options For Embedded Chart Studio Graphs in R

How to set configuration options of embedded Chart Studio graphs in R. Examples of both online and offline configurations.


New to Plotly?

Plotly is a free and open-source graphing library for R. We recommend you read our Getting Started guide for the latest installation or upgrade instructions, then move on to our Plotly Fundamentals tutorials or dive straight in to some Basic Charts tutorials.

Online Configuration Options

Configuration options for graphs created with the plotly R package are overridden when those graphs are published to Chart Studio using the api_create() function.

To set configutation options for charts published to Chart STudio, you can edit the plot's embed url.

Visit our embed tutorial 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:

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

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

Remove the 'mode bar':

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

Reference

Arguments are documented here.