🏥 🏭 Working on the COVID-19 response in Canada? Plotly & the Canadian government can help you and your organization. Learn more and get in touch.

Updating Graphs Stored In Chart Studio in R

How to update graphs stored in Chart Studio with R.


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.

Save R Plot To Chart Studio

Using the plotly R package, you can create a Chart Studio figure based on your R chart. Simply pass your chart as a parameter to the api_create() function:

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

How To Overwrite An Existing Plot

By default, when you call api_create(), a new plot is created in your Chart Studio account with its own unique URL.

If you would like to overwrite an existing plot in your Chart Studio account and keep the same URL, then supply a filename as an extra parameter to the api_create() function. This will keep the same URL for the plot.

api_create(p, filename = "name-of-my-plotly-file")

Saving Plots In Folders

If the filename parameter contains the character "/", then the api_create() function will save that plot in a folder in your Chart Studio account.

This option is only available for Chart Studio Enterprise subscribers

api_create(p, filename="r-docs/name-of-my-chart-studio-file")

Viewing Saved Plots

View the R graphs you have saved in your Chart Studio account at https://plotly.com/organize.