library(ggplot2) DATA <- read.csv(file.choose(), header=TRUE) DATA$GROUP <- factor(DATA$GROUP, levels=rev(c("Racial resentment of 0 on 0-to-12 index (N=66)","Racial resentment of 0 or 1 on a 0-to-12 index (N=107)","Racial resentment of less than 6 on a 0-to-12 index (N=298)","At least 1 negative stereotype of Whites compared to Blacks (N=165)","At least 2 negative stereotypes of Whites compared to Blacks (N=87)","Three negative stereotypes of Whites compared to Blacks (N=43)","Rated Whites < 50 on 0-to-100 thermo but Blacks 50 or above (N=39)","Rated Whites >50 lower than Blacks on 0-to-100 thermo (N=13)","Rated Whites lower than Blacks on 0-to-100 thermo (N=205)"))) ggplot(DATA, aes(100*PE, GROUP)) + geom_rect(aes(xmin=0, xmax=Inf, ymin=-Inf, ymax=Inf), color="black", fill="slategray3") + geom_errorbarh(aes(xmin=100*CILO.95, xmax=100*CIHI.95), height=0, size=0.5, color="gray70") + geom_errorbarh(aes(xmin=100*CILO.83, xmax=100*CIHI.83), height=0, size=1.5) + geom_point(shape=21, color="black", fill="slategray3", size=4, stroke=2) + scale_x_continuous(name="", breaks=seq(-100,20,20), limits=c(-100,20), labels=scales::number_format(accuracy=1)) + geom_text(aes(x=20, label=scales::percent(PE, accuracy=1L)), position=position_dodge(width=0.7), hjust=1, size=4.5) + labs(title="Pro-Black Mock Juror Bias, among Whites", caption="Thick error bars are 83.4% confidence intervals; thin error bars are 95% confidence\nintervals. Estimates are from unweighted analyses, indicating percentage point\ndifferences in rating the Black target guilty relative to the White target. Total\nN is 649 Whites with responses for the 'guilty' item. Data source: Rice et al. 2021") + theme( plot.background=element_rect(fill="white"), strip.background=element_rect(color="black", fill="black"), strip.text.x=element_text(color="white", face="bold", size=15, margin=margin(t=7.5, b=7.5)), panel.grid.major.x=element_blank(), panel.grid.major.y=element_blank(), panel.grid.minor.x=element_blank(), panel.grid.minor.y=element_blank(), panel.background=element_rect(fill="gray90", color="black", size=0.5, linetype="solid"), panel.border=element_rect(fill=NA, color="black", linetype="solid", size=1.5), panel.spacing.x=unit(1, "lines"), panel.spacing.y=unit(1, "lines"), axis.title.y=element_blank(), axis.title.x=element_text(size=12, color="black"), axis.ticks.y=element_blank(), axis.ticks.x=element_blank(), axis.text.x=element_text(size=12, color="black", vjust=-1), axis.text.y=element_text(size=12, color="black", margin=margin(r=10)), plot.margin=unit(c(0.5,0.5,0.5,0.5),"cm"), plot.title=element_text(face="bold", margin=margin(t=0, b=13), size=15, hjust=0.5), plot.subtitle=element_text(hjust=0.5, size=12), plot.caption=element_text(hjust=0, size=9)) ggsave(file="D:R plot Pro-Black GUILTY 83 95.svg", width=10.5, height=4.5)