通读 , 的帮助axis
,?axis
查看...
参数的文档:
...: other graphical parameters may also be passed as arguments to
this function, particularly, ‘cex.axis’, ‘col.axis’ and
‘font.axis’ for axis annotation, ‘mgp’ and ‘xaxp’ or ‘yaxp’
for positioning, ‘tck’ or ‘tcl’ for tick mark length and
direction, ‘las’ for vertical/horizontal label orientation,
or ‘fg’ instead of ‘col’, and ‘xpd’ for clipping. See ‘par’
on these.
因此,只需cex.axis
像axis
对plot
. 这是一个可重现的示例(请注意我是如何组成数据的,即使数据不真实,至少它使示例具有可重现性并且仍然可以解决您的问题):
x1 <- runif(10)
x2 <- runif(10) * 2 + 32.5
y <- runif(10) * 300
par(mar=c(4, 4, 8, 4))
plot(x2,y, type="l",col="darkgrey",ylim=rev(range(0,300)),las=2,xlim=(range(32.5,34.5)),xaxt='n',xlab='',font.axis=2,lwd=3,ylab="Depth [m]",font=2,font.lab=2,cex.lab=1.3,cex.axis=1.2)
# added in various font/axis labels as in above
axis(side=3, line=4,font.axis=2,font.lab=2,cex.lab=1.3,cex.axis=1.2)
par(new=TRUE)
plot(x1,y, type="l",col="black",ylim=rev(range(0,300)),las=2,xaxt='n',xlab='',lwd=3,ylab='Depth [m]',font=2,font.lab=2,cex.lab=1.3,cex.axis=1.2)
axis(side=3, line=0,font.axis=2,font.lab=2,cex.lab=1.3,cex.axis=1.2)
(您随后调用axis
where从调用中替换轴plot
,因此不使用来自plot
它的轴参数,而是使用来自的轴参数axis
)。