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!
##  '220.127.116.1100'
The common image formats: 'PNG', 'JPG/JPEG' are supported. In addition, formats like 'EPS', 'SVG' and 'PDF' are also supported.
Note: The SVG, EPS and PDF Formats are only available for Plotly Professional users. You can get more details on our pricing page.
To access the image in a particular format, you can either:
orca()function. Orca is Plotly's command line applications for generating static images.
export the image on plotly's servers using
append the format extension to the plot url. i.e. the JPG version of the plot: https://plot.ly/~chris/1638 is available at : https://plot.ly/~chris/1638.jpg.
4.7.900 and above includes the
orca() function (replacing the
export() function), which exports images locally, but requires the processx package:
if (!require("processx")) install.packages("processx") p <- plot_ly(z = ~volcano) %>% add_surface() orca(p, "surface-plot.png")
Export Using Your Plotly Account
Another option is to do image export through your plotly account.
First, you will require the development version of plotly, this can be installed using
devtools::install_github("ropensci/plotly"). In addition, if you haven't already, let the R package know about your credentials.
Sys.setenv("plotly_username" = "YOUR USER NAME") Sys.setenv("plotly_api_key" = "YOUR API KEY")
This option will export the image on plotly's servers and write the content to a local file
"output.png" in your working directory.
library(plotly) p <- plot_ly(x = c(1,2,3,4), y = c(2,4,1,3), type = 'scatter', mode = 'lines') plotly_IMAGE(p, format = "png", out_file = "output.png")
Appending File Type to URL
You can also view the static version of any Plotly graph by appending
.svg to the end of the URL. For example, view the static image of https://plot.ly/~chris/1638 at https://plot.ly/~chris/1638.png. See Using Plotly with rmarkdown/knitr for a way to embed these links in rmarkdown/knitr (Rmd) files.