首先配置数据
数据格式如下:
library(plotrix)
data = read.table("data_A.txt",sep="\t",header=T)
tiff(file="data_A.tiff",width = 15,height = 15,units ="cm",compression="lzw",bg="white",res=300)
xpos<-1:12
twoord.plot(lx=xpos,ly=data$Count,rx=xpos,ry=data$p.adjust,
ylab="",
xlab="",rylab="",main="",
rylim=c(0,0.08),lylim=c(0,30),type=c('bar','l'),halfwidth=0.2,
lcol="steelblue",rcol="red",axislab.cex=1.2)
legend("topright",legend=data$Description,cex=0.5)
dev.off()
legend是用来专门添加右上角的文本注释的