简体   繁体   English

有人可以帮我弄清楚为什么我的y轴和x轴标签没有显示吗?

[英]Can anybody help figure out why my labels for the y-axis and x-axis are not appearing?

As part of my code to have a 4 rows by 2 columns panel with 8 plots I was suggested to use the code below as an example but when doing so I cannot get the text on the y and x axis. 作为我的代码的一部分,要有一个4行2列,具有8个图的面板,建议使用以下代码作为示例,但这样做时,我无法在y和x轴上获取文本。 Please see the code below. 请参见下面的代码。

#This is the code to have the plots as 4 x 2 in the page 
m <- rbind(c(1,2,3,4), c(5,6,7,8) )
layout(m)
par(oma = c(6, 6, 1, 1)) # manipulate the room for the overall x and y axis titles
par(mar = c(.1, .1, .8, .8)) # manipulate the plots be closer together or further apart

###this is the code to insert for instance one of my linear regression plots as part of this panel (imagine I have other 7 identical replicates of this)
####ASF 356 standard curve 
asf_356<-read.table("asf356.csv", head=TRUE, sep=',')
asf_356

# Linear Regression  
fit <- lm( ct ~ count, data=asf_356)
summary(fit) # show results
predict.lm(fit, interval = c("confidence"), level = 0.95, add=TRUE)
newx <- seq(min(asf_356$count), max(asf_356$count), 0.1)
a <- predict(fit, newdata=data.frame(count=newx), interval="confidence")
plot(x = asf_356$count, y = asf_356$ct, xlab="Log(10) for total ASF 356 genome copies", ylab="Cycle threshold value", xlim=c(0,10), ylim=c(0,35), lty=1, family="serif")
curve(expr=fit$coefficients[1]+fit$coefficients[2]*x,xlim=c(min(asf_356$count),                                                       max(asf_356$count)),col="black", add=TRUE, lwd=2) 
lines(newx,a[,2], lty=3)
lines(newx,a[,3], lty=3)
legend(x = 0.5, y = 20, legend = c("Logistic regression model", "95% individual confindence interval"), lty = c("solid", "dotdash"), col = c("black", "black"), enter code herebty = "n")    
mod.fit=summary(fit)
r2 = mod.fit$r.squared
mylabel = bquote(italic(R)^2 == .(format(r2, digits = 3)))
text(x = 8.2, y = 25, labels = mylabel)
legend(x = 7, y = 35, legend =c("y= -3.774*x + 41.21"), bty="n")

I have been able to find a similar post here and the argument that I was missing was : 我已经能够在这里找到类似的帖子,而我所缺少的论据是:

title(xlab="xx", ylab="xx", outer=TRUE, line=3, family="serif")

Thanks 谢谢

Finally I have my work..thanks to whom helped me before as well 最后我有了我的工作..也感谢谁曾经帮助过我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM