如何编辑图表中的表达式"setosa"?
How to edit the expression "setosa" in the chart?
我想编辑这个词: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
我的图表:
您想删除 x 轴上的标签:
theme (legend.position="none",
axis.text.x = element_blank())
我想编辑这个词: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
我的图表:
您想删除 x 轴上的标签:
theme (legend.position="none",
axis.text.x = element_blank())