在r中的情节条形图中避免传奇

时间:2018-03-11 19:22:34

标签: r bar-chart plotly

在此图Bar chart with description中,我想隐藏附加图像中出现在正方形中的文字。

p <- plot_ly(
     x = ~df1$x1,
     y = ~df1$y1,
     name = "Most frequent words",
     type = "bar",
     mode="markers" ,

color = ~df1$x1 ,
colors=c("red","blue") , showlegend = FALSE,

) %>%
layout(
    title = "Most frequent words for #Dante2018",
    yaxis = list(title = 'Frequency'),
    xaxis = list(title = 'Word', tickangle = -45))

1 个答案:

答案 0 :(得分:0)

尝试像这样添加hoverinfo = 'x+y' -

p <- plot_ly(
     x = ~df1$x1,
     y = ~df1$y1,
     name = "Most frequent words",
     type = "bar",
     mode="markers" ,

color = ~df1$x1 ,
colors=c("red","blue") , showlegend = FALSE,
hoverinfo = 'x+y'
) %>%
layout(
    title = "Most frequent words for #Dante2018",
    yaxis = list(title = 'Frequency'),
    xaxis = list(title = 'Word', tickangle = -45))