我一直在使用以下代码。但是,x 轴不是从 -5000 开始,而是从 0 开始。另外,我想为 x 轴和 y 轴范围指定 100 的间隔。我尝试使用xaxt='n'
and axis(side=1)
,但这没有帮助。以下代码是我目前正在处理的代码
setwd("/path/")
data<-read.table("input.txt",sep="\t",header=F)
x<-data$V4
h<-hist(x, col="green",xlim=c(-5000, 162000),ylim=c(0,0.0003),main="TPMDistribution",xlab="TPMValues",probability=TRUE)
s=sd(x)
m=mean(x)
curve(dnorm(x,mean=m,sd=s),add=TRUE,lwd=3,col="red")
lines(density(x),col="blue")
abline(v=mean(x),col="blue")
mtext(paste("mean",round(mean(x),1),";sd",round(sd(x),1),";N",length(x),sep=""),side=1,cex=.75)
dev.off()
所有帮助表示赞赏。提前致谢。