Reputation: 243
I try to find a way to save a plotly graph as png without installing orca (I'm not allowed to).
It appears that if I plot my graphics, lets say :
library(dplyr)
library(plotly)
p <- plot_ly(z = ~volcano) %>% add_surface()
p
and then clic on export>save as image>Save as png, the resulting static plot is available on my computer
But If I try to use classical png()
like this :
png("myvolcano.png")
plot_ly(z = ~volcano) %>% add_surface()
dev.off()
I get a blank png...
(while it's working for a classical plot(1)
)
How to reproduce by code what I get from the menu bar ?
Thank you!
Upvotes: 2
Views: 492
Reputation: 961
Hi this is more a comment than an answer but my reputation does not allow me to comment.
You can use 2 strategies to export plotly graphs:
In the past there was a function export() but it is deprecated now. Hope this helps.
Upvotes: 1