[英]ggplotly removing observations from ggplot
我正在嘗試創建一個圖表,顯示某個部門的論文收到的引用次數。 我希望它是一個交互式繪圖,以便在懸停特定條目時顯示更多信息。
很少引用的論文在 ggplotly 版本中被抑制,但我希望它們仍然像在 ggplot 中一樣顯示。
這是我正在使用的代碼:
library(tidyverse)
library(plotly)
download.file("https://raw.githubusercontent.com/luizaandrade/dec-bibliometrics-dashboard/main/citations.rds",
"data.rds",
method = "curl")
data <- readRDS("data.rds")
graph <-
data %>%
ggplot() +
geom_segment(
aes(x = year_scholar,
xend = year_scholar,
y = start,
yend = end,
color = year_id,
text = paste0(title, "<br>",
all_authors, "<br>",
journal, "<br>",
"Citations: ", cites)),
size = 10,
lineend = "butt")
ggplotly(graph,
tooltip = "text")
ggplot 看起來像這樣:
情節版本如下所示:
有什么建議?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.