ggplotly从aes打印一些东西,即“ alpha”和“ Continent”,我不知道为什么会这样。.请帮助删除它!
看右上角->
带有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"))
})
})
答案 0 :(得分:0)
export DYLD_LIBRARY_PATH=/usr/local/opt/openblas/lib
是图例标题。要更改它,您可以执行以下操作:
Continent
要摆脱...... + scale_color_discrete(name = "MY_LEGEND_TITLE")
,请将其设置在alpha
之外:
aes