I am attempting to create a figure with a break in the axis.
It creates the .jpg image, but it prints two sets of x-axis labels in the process (see attached picture).
What error in the code is resulting in this problem?
results = read.table("./ceu_asn_afr.txt",head=T)
library(plotrix)
jpeg("Figure1.1.jpg",width=2000,height=2000,res=300)
xgap <- ifelse(as.numeric(results[,1]) > 1.9, as.numeric(results[,1])-0.4, as.numeric(results[,1]))
plotCI(xgap,as.numeric(results[,3]),ui=as.numeric(results[,5]),li=as.numeric(results[,4]),err="y",gap=TRUE,sfrac=0.005, xlab="European odds ratio",ylab="African American odds ratio",cex=1.5,bty="l")
xat <- pretty(xgap)
xat <- xat[xat!=1.6]
xlab <- ifelse(xat>1.5, xat+0.4, xat)
axis(1,at=xat, labels=xlab)
axis.break(1,1.9,style="slash")
lines(c(0.75,2.5),c(0.75,2.5),lty=2)
close.screen(all=TRUE)
dev.off()