[英]R: make the text bold for the legend and the xlab & ylab parameters in a plot?
I must make all of the text in my plot bold.我必须使情节中的所有文本都加粗。
I am plotting densities using this:我正在使用这个绘制密度:
par(mfrow=c(1,1),family="serif")
plot(density(rxyTop30),col="green",lty=1,lwd=3,bty="l",main="",
xlab=expression(paste(R[xy])),xlim=c(0.0,0.5),ylim=c(0,12),font=2)
lines(density(jfTop30),col="blue",lty=1,lwd=3)
legend("topright",c(expression(paste(R[xy]," with 30 ancestors with most
progeny"),paste(beta," (",alpha," = 0.96",", ",beta, " = 8.031)"))),
lwd=c(3,3),lty=c(1,1),col=c("green","blue"),bty="n")
I tried inserting font=2
in different places within the code.我尝试在代码中的不同位置插入
font=2
。 It only made the tick numbers bold on each axis.它只使每个轴上的刻度数字变粗。
The argument font
controls the state of the tick numbers.参数
font
控制刻度数字的状态。 If you want the axis labels to be bold you need the argument font.lab=2
.如果您希望轴标签为粗体,则需要参数
font.lab=2
。 Ie, the following code...即,以下代码...
plot(density(rxyTop30),col="green",lty=1,lwd=3,font.lab=2,bty="l",main="",
xlab=expression(paste(R[xy])),xlim=c(0.0,0.5),ylim=c(0,12),font=2)
lines(density(jfTop30),col="blue",lty=1,lwd=3)
legend("topright",c(expression(paste(R[xy]," with 30 ancestors with most
progeny"),paste(beta," (",alpha," = 0.96",", ",beta, " = 8.031)"))),
lwd=c(3,3),lty=c(1,1),col=c("green","blue"),bty="n")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.