ggplot中的可点击“填充”

时间:2017-12-09 09:06:23

标签: r ggplot2

url <- c( "http://url1" , "http://ur2")
word <- c( "word1" , "word2")
n <- c( 1 , 1)
res <- as_tibble(data.frame("url"=url , "word"=word stringsAsFactors = F))
res

呈现tibble:

# A tibble: 2 x 4
    url     word     n score
  <chr>    <chr> <dbl> <dbl>
1    t1 abnormal     1     1
2    t2     good     1     2

然后我使用:

渲染geom_col
ggplot(data=res) + geom_col(show.legend = TRUE, mapping=aes(x=url , y=score, fill=url))

呈现:

enter image description here

图表右侧的网址栏和/或填充选项是否可以点击?因此,点击右边的栏和/或网址'选项'会打开关联的网址,在这种情况下为"http://url1""http://ur2"

0 个答案:

没有答案
相关问题