Hello there !
I am a beginner in plotly (very nice package by the way, thank you very much for this great job) and I am completely stuck on a very simple problem.
I try to embed a logo in my graph as here (https://plot.ly/r/logos/). When I take the example of this web page everything works correctly.
However, when I change the source of my image from a local image, no background is printed. I think that I have not correctly set up the parameters of my image layout but I cannot figure out how !!
I tried to look on the similar topics (http://stackoverflow.com/questions/39590845/embed-image-in-plotly , http://stackoverflow.com/questions/39490549/adding-an-image-logo-in-plotly-pie-chart) but I still don’t find my answer.
Here is my code:
library(plotly)
outfile <- tempfile(fileext = ".png")
png(outfile)
plot(rnorm(200), rnorm(200))
dev.off()
plot_ly(x = c(1, 2, 3), y = c(1, 2, 3)) %>%
layout(
images = list(
list(
source = outfile,
xref = "x",
yref = "y",
x = 1,
y = 1,
sizex = 2,
sizey = 2,
sizing = "stretch",
opacity = 0.4,
layer = "below"
)
)
)
Does anyone have an idea why it is not working?
Thank you very much in advance !!
Cha