【发布时间】:2020-10-16 04:46:11
【问题描述】:
我只是想突出显示某些数据点(图像中的红色数据点),而不是其他数据点,分别代表预期的上学年数和学习调整的上学年数。我要强调的数据点是针对撒哈拉以南非洲的美国主要出口市场——有 5 个。我需要这些点出现在其他点之上,因为它们是我要强调的与世界其他地区和其他 SSA 国家。我已经尝试对数据进行子集化,并使用额外的 geom_point 代码将这 5 个点分层。
如果有人可以帮助我,我将不胜感激。Learning-adjusted vs. expected (ROW vs SSA)
LAYvsEY<-ggplot(HC,aes(expected,learning,label=HC$`Country Name`))+
geom_point(aes(fill=Comparison),pch=21,size=10)+
labs(x="Expected Years of School",y="Learning-Adjusted Years of School")+
ggtitle("Learning-adjusted Education vs. Expected Years of Schooling",subtitle="Sub-Saharan Africa vs. ROW")+
stat_smooth(method="gam",se=TRUE,color="navy",show.legend=FALSE)+geom_text(check_overlap=TRUE,family="serif")+theme_stata(base_size=12,base_family="serif")+
guides(color=guide_legend(override.aes=list(size=7)))+scale_y_continuous(breaks=c(2,4,6,8,10,12))+
theme(legend.title=element_blank(),legend.position=c(0.12,0.88),
legend.background=element_rect(colour=NA,fill=NA),
panel.border=element_rect(color="black",fill="NA"),
plot.subtitle=element_text(face="italic"))+
scale_fill_manual(values=c("#A6CEE3","#B2DF8A","indianred"),breaks=c("Rest of World","Sub-Saharan Africa","Primary SSA Export Market"))
【问题讨论】: