首页 > 解决方案 > 如何压缩情节

问题描述

这里的总数超出了情节,谁能告诉我如何压缩这个东西,以便它的值显示在情节中

ggplot(data = impact_end_Last_fiscal_yr_qtr, aes(x = qtr_yr, y = gender_value)) + 
  geom_bar(stat="identity",aes(fill = gender))+theme_classic()+
  geom_text(aes(label = stat(y), group=qtr_yr), 
            stat = "summary", fun = sum, vjust=-1)+
  geom_line(data = line_plan_impact_end_Last_fiscal_yr_qtr, aes(x=m_year, y= gender_value, group=1,color="Plan"),size=1.2)+
  geom_point(data = line_plan_impact_end_Last_fiscal_yr_qtr, aes(x=qtr_yr, y=gender_value),color="#288D55")+
  scale_colour_manual(name="",values=Plan)+
  theme(axis.line.y = element_blank(),axis.ticks = element_blank(),legend.position = "bottom", axis.text.x = element_text(face = "bold", color = "black", size = 10, angle = 45, hjust = 1),plot.margin = margin(0, 1, 0, 0, "cm"))+
  labs(x="", y="End Beneficiaries (in Num)", fill="")+
  scale_fill_manual(values=c("#284a8d", "#00B5CE","#0590eb","#2746c2"))+
  scale_y_continuous(labels = function(x) format(x, scientific = FALSE),breaks = integer_breaks())[![my output][1]][1]

标签: rggplot2

解决方案


推荐阅读