直接税<-c(40189,38096,37422,34967,36968,35851,37428,38800,41963,40878,40116,38954,40228,42205,41462,42091) 社会保険料<-c(48019,48491,48645,49008,48284,47374,46719,47269,49388,49310,50540,50531,53173,55155,54694,56223) library(ggplot2) df<-data.frame(Year,消費支出,直接税,社会保険料) g <- ggplot(data=df) g <- g + geom_bar(aes(x =Year,y =消費支出),stat = "identity",colour="gray50",fill="lightblue") g <- g + geom_line(aes(x =1:nrow(df),y =直接税),stat="identity",colour="red") g <- g + geom_point(aes(x =1:nrow(df),y =直接税),stat="identity",colour="red",size=2) g <- g + geom_text(aes(x =nrow(df)/2,y =min(df$直接税)),label="直接税",colour="red",size=6, family = "serif", vjust=1.5) g <- g + geom_line(aes(x =1:nrow(df),y =社会保険料),stat = "identity",colour="blue") g <- g + geom_point(aes(x =1:nrow(df),y =社会保険料),stat = "identity",colour="blue",size=2) g <- g + geom_text(aes(x =nrow(df)/2,y =max(df$社会保険料)),label="社会保険料",colour="blue",size=6, family = "serif", vjust=-0.1) g <- g + labs(x="",y="",title="1世帯当たり年平均1か月間の消費支出") g <- g + theme_bw() g <- g + scale_y_continuous(expand =c(0,0),limits=c(0,max(df$消費支出)*1.1),breaks = c(0,100000,200000,300000),labels = c("0","100,000", "200,000", "300,000")) g <- g + theme(text=element_text(size=12,family="TakaoExMincho")) g
|