如何使用 R 中的库(Hmisc)在第 3 侧和第 4 侧的轴的图中绘制 minor.tick?例如,minor.tick 绘制轴(side=1 和 2)的次要刻度,但不会为轴(side =3 和 4)生成任何次要刻度
rain1=c(0,100,200,300)
plot(data$TimeVariable2A,data$Variable2A,axes=FALSE,xlab="",ylab="",xlim=c(0,16),
ylim=c(0,40),xaxs="i",yaxs="i",pch=19)
lines(data$TimeVariable3A,data$Variable3A)
axis(2,tick=T,at=seq(0,40,by=10),label= seq(0,40,by=10))
axis(1,tick=T,at=seq(0,16,by=4),label=seq(0,16,by=4))
par(new=TRUE)
plot(data$TimeVariable1A,data$Variable1A,axes=FALSE,xlab="",ylab="",type="l",ylim=c(800,0),xaxs="i",yaxs="i")
axis(4,tick=TRUE,at=rain1,label=rain1,col.axis="blue",col="blue")
axis(3,xlim=c(0,16),tick=T,at=seq(0,16,by=4),label=seq(0,16,by=4),col.axis="blue",col="blue")
polygon(data$TimeVariable1A,data$Variable1A,col='blue',border=NA)
minor.tick(nx=5,ny=5)