ggplotly中的Aes

时间:2019-02-21 09:21:05

标签: r shiny ggplotly

ggplotly从aes打印一些东西,即“ alpha”和“ Continent”,我不知道为什么会这样。.请帮助删除它!

看右上角->

My shiny app page

带有ggplot的代码的一部分:

server <- function(input, output) {    
  observe({
    output$plot1 <- renderPlotly({
      p <- ggplot(df1(), aes(x = df1()[,4], y = Happiness.Score))
      p <- p + geom_point(size = 2, aes(text = paste("Country:", df1()[,1]), color = Continent,  alpha = 0.85)) + 
        labs(title = "How happy is the country?", x = names(df1())[4], y = "Happiness Score") + 
        theme_light(base_size = 12) + ylim(2,8) 
      ggplotly(p, tooltip = c("text", "y"))
    })
  })

1 个答案:

答案 0 :(得分:0)

export DYLD_LIBRARY_PATH=/usr/local/opt/openblas/lib 是图例标题。要更改它,您可以执行以下操作:

Continent

要摆脱...... + scale_color_discrete(name = "MY_LEGEND_TITLE") ,请将其设置在alpha之外:

aes