【问题标题】:How to edit the expression "setosa" in the chart?如何编辑图表中的表达式“setosa”?
【发布时间】:2016-04-22 13:03:39
【问题描述】:

我想编辑这个词:setosa。我尝试过实验室和主题,但我无法更改。

# My code:

d <- iris

my_graph <- function(i){

d %>% filter(Species== i) %>%

ggplot(aes(x=i,y=Sepal.Length,fill=i)) + geom_boxplot() +labs(x="title", y="title") + theme (legend.position="none")  -> grafico


return(grafico)

}

for( i in unique(d$Species)){
assign(paste0('gr_',i),
my_graph(i))
}

gr_setosa

我的图表:

This graph is the result of the above code

【问题讨论】:

    标签: r filter ggplot2 boxplot


    【解决方案1】:

    您要移除 x 轴上的标签:

    theme (legend.position="none",
               axis.text.x = element_blank())
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多