{ x %>% mutate(country = reorder(country, score, decreasing = TRUE)) %>% fn() }, .keep = TRUE) } g_col <- data_scores %>% reorder_group(function(df) geom_col(data = df, position = position_dodge())) g_text <- d
分组柱状图 #每个柱子添加数据 mpg%>%group_by(class,drv)%>%summarise(count=n())%>%ggplot(aes(class,count))+geom_col(aes(fill=drv),position=position_dodge2(preserve='single'))+geom_text(aes(label=count),position=position_dodge2(width=0.8,preserve='single'),vjust=-0.5,hjust=0.5) 分组柱状...