Reputation: 12102
I would like to know why the distance between the axes and axes labels differs on both axes? How can this be fixed? Sample code and figure below.
png("test.png",height=7,width=7,units="cm",res=300)
par(mar=c(1,1,1,1))
par(mgp=c(1,0.2,0))
plot(x=1:10,y=1:10,axes=F,xlab="",ylab="")
box()
axis(side=1,cex.axis=0.5,tcl = -0.12)
axis(side=2,cex.axis=0.5,tcl = -0.12)
dev.off()
Upvotes: 2
Views: 459
Reputation: 891
You can adjust the position of labels with the padj
and hadj
options:
axis(side=1,cex.axis=0.5,tcl = -0.12, padj=-1, hadj=0.5)
axis(side=2,cex.axis=0.5,tcl = -0.12, padj=0, hadj=0.5)
Upvotes: 1