【问题标题】:Embed image in Plotly在 Plotly 中嵌入图像
【发布时间】:2016-09-20 09:46:38
【问题描述】:

我正在尝试在 Plotly 图中嵌入图像,但不知何故,图像未显示。有谁知道我错过了什么:

library(plotly)
p <- plot_ly(x=c(1, 2, 3), y=c(1, 2, 3), type='scatter')
p2 <-
p %>%
layout(images = list(
list(source = "https://images.plot.ly/language-icons/api-home/python-logo.png",
     xref = "paper",
     yref = "paper",
     x= 0,
     y= 1,
     sizex = 0.2,
     sizey = 0.2,
     opacity = 0.8)
)
)
p2

【问题讨论】:

  • 代码在 Windows 10 上使用 Plotly 4.5.6 和 RStudio 1.0.136 非常适合我。

标签: r plotly


【解决方案1】:

可能是“源”中的问题-

指定要使用的图像的 URL。 URL 必须是可访问的 来自运行绘图代码的域,并且可以是相对的 或绝对的。

还有第二个你不需要的清单。

layout(images =
  list(source = "https://images.plot.ly/language-icons/api-home/python-logo.png"...

【讨论】:

  • 我不这么认为,因为这是情节页面中的一个示例:plot.ly/r/logos
  • 情节页面上给出的示例也不适用于我:[link] plot.ly/r/logos
  • 这对我也不起作用,有人找到解决方案了吗?
猜你喜欢
  • 2021-07-26
  • 2016-08-19
  • 2021-03-24
  • 2021-08-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-10
  • 2013-10-21
相关资源
最近更新 更多