Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R Can';t在带有注释的绘图上以绘图方式实现GGU_R_Ggplot2_R Plotly_Ggplotly - Fatal编程技术网

R Can';t在带有注释的绘图上以绘图方式实现GGU

R Can';t在带有注释的绘图上以绘图方式实现GGU,r,ggplot2,r-plotly,ggplotly,R,Ggplot2,R Plotly,Ggplotly,我正在绘制一个冰场上拍摄位置的数据集。我想使用plotly让用户能够在悬停在每个点上时看到描述框。我想这可以用 溜冰场存储在溜冰场对象中 rink一个好的解决方案是直接使用plotly创建绘图: library(plotly) example_data %>% plot_ly(x = ~coords_x, y=~coords_y, text=~paste("Event team:", event_team, "<br>Event type:", event_

我正在绘制一个冰场上拍摄位置的数据集。我想使用
plotly
让用户能够在悬停在每个点上时看到描述框。我想这可以用

溜冰场存储在
溜冰场
对象中


rink一个好的解决方案是直接使用plotly创建绘图:

library(plotly)

example_data %>%
plot_ly(x = ~coords_x, y=~coords_y, 
        text=~paste("Event team:", event_team, "<br>Event type:", event_type))  %>% 
add_markers(marker=list(size=20)) %>%
layout(
xaxis = list(range = c(-100,100)), 
yaxis = list(range = c(-45,45)),
images= list(
    list(
         source= "https://i.imgur.com/Y2kOUX5.png",
         xref= "paper",
         yref= "paper",
         x= 0,
         y= 1,
         sizex= 1,
         sizey= 1,
         opacity= 0.8,
         layer = "below")
       )
)
library(plotly)
示例\u数据%>%
plot_ly(x=~coords_x,y=~coords_y,
text=~粘贴(“事件组:,事件组,”
事件类型:,事件类型))%>% 添加标记(标记=列表(大小=20))%>% 布局( xaxis=list(范围=c(-100100)), yaxis=list(范围=c(-45,45)), 图像=列表( 名单( 来源=”https://i.imgur.com/Y2kOUX5.png", xref=“纸张”, yref=“纸张”, x=0, y=1, sizex=1, sizey=1, 不透明度=0.8, layer=“below”) ) )
警告。从链接下载的图像 是删除白色边框后的原始图像


一个好的解决方案是直接使用plotly创建绘图:

library(plotly)

example_data %>%
plot_ly(x = ~coords_x, y=~coords_y, 
        text=~paste("Event team:", event_team, "<br>Event type:", event_type))  %>% 
add_markers(marker=list(size=20)) %>%
layout(
xaxis = list(range = c(-100,100)), 
yaxis = list(range = c(-45,45)),
images= list(
    list(
         source= "https://i.imgur.com/Y2kOUX5.png",
         xref= "paper",
         yref= "paper",
         x= 0,
         y= 1,
         sizex= 1,
         sizey= 1,
         opacity= 0.8,
         layer = "below")
       )
)
library(plotly)
示例\u数据%>%
plot_ly(x=~coords_x,y=~coords_y,
text=~粘贴(“事件组:,事件组,”
事件类型:,事件类型))%>% 添加标记(标记=列表(大小=20))%>% 布局( xaxis=list(范围=c(-100100)), yaxis=list(范围=c(-45,45)), 图像=列表( 名单( 来源=”https://i.imgur.com/Y2kOUX5.png", xref=“纸张”, yref=“纸张”, x=0, y=1, sizex=1, sizey=1, 不透明度=0.8, layer=“below”) ) )
警告。从链接下载的图像 是删除白色边框后的原始图像


嘿,马可,我在SO上发布了一个后续问题:也许你可以在这里插话?非常感谢。嘿,马可,我在网上发布了一个后续问题:也许你可以在这里插话?非常感谢。
Warning message:
In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
  geom_GeomCustomAnn() has yet to be implemented in plotly.`
library(plotly)

example_data %>%
plot_ly(x = ~coords_x, y=~coords_y, 
        text=~paste("Event team:", event_team, "<br>Event type:", event_type))  %>% 
add_markers(marker=list(size=20)) %>%
layout(
xaxis = list(range = c(-100,100)), 
yaxis = list(range = c(-45,45)),
images= list(
    list(
         source= "https://i.imgur.com/Y2kOUX5.png",
         xref= "paper",
         yref= "paper",
         x= 0,
         y= 1,
         sizex= 1,
         sizey= 1,
         opacity= 0.8,
         layer = "below")
       )
)