# R语言简单绘图（一）

dose <- c(20,30,40,45,60)
dragA <- c(16,20,27,40,60)
dragB <- c(15,18,25,31,40)

plot(dose,dragA,type="b")
plot(dose,dragB,type="b")


opar <- par(no.readonly = TRUE)
par(lty=2, pch=17)
plot(dose,dragA, type = "b")
plot(dose, dragA, type="b", lty=2,pch=19)


plot(dose, dragA, type = "b", lty=6, lwd=2, pch=11,cex=3, col="blue")
plot(dose, dragA, type = "b", lty=6, lwd=2, pch=11,cex=3, col="blue",col.axis="red")
plot(dose, dragA, type = "b", lty=6, lwd=2, pch=11,cex=3, col="blue",col.axis="red",col.lab="green")


opar <- par(no.readonly = TRUE)
par(pin=c(2,3))
par(lwd=2,cex=1.5)
par(cex.axis=0.75, font.axis=3)
plot(dose, dragA,type="b",pch=19, lty=2, col="red")


plot(dose, dragB,type="b",pch=23, lty=6, col="blue", bg="green")


par(opar)
plot(dose, dragA, type="b", col="red", lty=2, pch=2, lwd=2, main = "药物A的反应曲线", sub="测试数据",xlab="剂量",ylab="病人的反应", xlim=c(0,60),ylim=c(0,70))


plot(1:4, 1:4, type="b")
minor.tick(nx=3, ny=2, tick.ratio = 0.5)
abline(h=2, col="red",lty=2)
abline(v=2, col="blue",lty=1)


dose <- c(20,30,40,45,60)
dragA <- c(16,20,27,40,60)
dragB <- c(15,18,25,31,40)
plot(dose, dragA,type="b",pch=15,lty=1,col="red",ylim=c(0,60),main="A与B的对比", xlab="剂量", ylab="药物反应")
lines(dose,dragB, type="b",pch=17,lty=2,col="blue")
legend("topleft", inset=0.05, title = "类型",legend=c("A","B"),lty=c(1,2),pch=c(15,17),col=c("red", "blue"))

• 点赞
• 评论
• 分享
x

海报分享

扫一扫，分享海报

• 收藏 3
• 手机看

分享到微信朋友圈

x

扫一扫，手机阅读

• 打赏

打赏

开开_王子

你的鼓励将是我创作的最大动力

C币 余额
2C币 4C币 6C币 10C币 20C币 50C币
• 一键三连

点赞Mark关注该博主, 随时了解TA的最新博文
06-08 6万+
08-28 3880

07-02 6865
05-07 3795
03-16 5万+
03-20 4692
11-29 4万+
03-11 1644
04-01 425