如何从R Plotly工具提示中删除神秘的tilda?

时间:2018-09-11 06:26:26

标签: r ggplot2 shiny r-plotly ggplotly

我正在使用R的ggplot,并将其通过ggplotly传递,以在我的Shiny应用中生成交互式图表。但是,我不知道为什么我的工具提示为什么在变量名之前始终显示“〜”符号,而且似乎无法删除它。这会显示在我的Shiny应用程序中的所有图表中。如何删除“〜”?我试图为plotly参数自定义工具提示,但似乎无济于事...

有人知道解决方案吗?

enter image description here

这是我的示例代码:

dat <- data.frame(
  ageGroups = factor(c("18-25","26-35", "36-45", "46-55", "56 and Above"), 
levels=c("18-25","26-35", "36-45", "46-55", "56 and Above")),
  ageCount = c(25,66,43,21,5)
)

p <- ggplot(data=dat, aes(x=ageGroups, y=ageCount, fill=ageGroups)) +
  geom_bar(stat="identity", width = 0.8) +
  xlab("Age Groups") +
  ylab("No. of Users") +
  theme_minimal() +
  theme(legend.position = "bottom") +
  scale_fill_brewer(palette = "Blues")

ggplotly(p, tooltip = "y")

0 个答案:

没有答案
相关问题