3
votes

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?

1
u have assigned the plot but not saved in any local storage right?sai saran

1 Answers

0
votes

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