一个基本例子

药物基本剂量与响应关系

dose <-c(20,30,40,45,60)
drugA<-c(16,20,27,40,60)
drugB<-c(15,18,25,31,40)
plot(dose,drugA,type = "b")

plot()用法

  • plot()函数的基本形式:plot(x,y,…)
    基本含义是,将x置于横轴,y置于纵轴,绘制(x,y)的点集,然后用线段将其连接起来。

  • 参数“…”,是用来说明画出什么类型的图形。
    具体用法如下:

  1. “p”for points,eg:

plot(dose,drugA,type = "p")

  1. “l”for lines,eg:

plot(dose,drugA,type = "l")

  1. “b”for both,eg:

plot(dose,drugA,type = "b")

  1. “c”for lines part alone of “b”,eg:

plot(dose,drugA,type = "c")

  1. “o” for both ‘overplotted’,eg:

plot(dose,drugA,type = "o")

  1. “h” for ‘histogram’ like (or ‘high-density’) vertical lines,eg:

plot(dose,drugA,type = "h")

  1. “s”for stair steps,

    “S”for other steps,eg:
plot(dose,drugA,type = "s")

plot(dose,drugA,type = "S")

  1. “n”for no plotting;

plot(dose,drugA,type = "n")