How can I export a Plotly chart as a image from R using code? (Not using the export button on the chart).
For example, this code from the Plotly site, create this ch
In the Plotly docs in CRAN I discovered the function plotly_IMAGE.
Here is a example:
set.seed(100)
d <- diamonds[sample(nrow(diamonds), 1000), ]
p <- plot_ly(d, x = carat, y = price, text = paste("Clarity: ", clarity),
mode = "markers", color = carat, size = carat)
plotly_IMAGE(p, width = 500, height = 500, format = "png", scale = 2,
out_file = "~/desktop/test.png")
plotly_IMAGE works using Plotly server. A local solution is welcome.