简体   繁体   中英

Export Plotly in R syntax

So I have a lot of plotly heatmaps that I need to export to .png format. I have searched and found the export function. However when used it brings up an error about webshot .

Here is an example of the kind of plots I am exporting (I have 1111 of these plots):

p <- plot_ly(z = volcano, type = "heatmap")

When I try the export(p, file = "plot11.png") command I get error:

Could not load file:///datatwo/13483885$/GCA%20Capstone/plotly28b83ffb3228.html
Error in webshot::webshot(f, file, ...) :
webshot.js returned failure value: 1

What should I do to trouble shoot this?

with processx package it can be done,

if (!require("processx")) install.packages("processx")
orca(p, "plot11.png") ##orca is the replace of export function

if u have plot_ly account u can easily export

Sys.setenv("plotly_username" = "YOUR USER NAME")
Sys.setenv("plotly_api_key" = "YOUR API KEY")
plotly_IMAGE(p, format = "png", out_file = "output.png")

sample ref link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM