Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在指定的时间间隔内向R中的现有绘图添加0值_R_Plot - Fatal编程技术网

在指定的时间间隔内向R中的现有绘图添加0值

在指定的时间间隔内向R中的现有绘图添加0值,r,plot,R,Plot,我在R有一个现有的地块 z <- seq(20, 50, by=1) plot (z, (3 / (z+1))^5, type="b", xlab=expression(theta), ylab=expression(paste("P(",theta,")"))) z您只需生成已有的点,然后将它们与一组零连接起来 z <- seq(20, 50, by=1) y <- (3 / (z+1))^5 z <- c(1:20,20:50) y <- c(rep(0,

我在R有一个现有的地块

z <- seq(20, 50, by=1)
plot (z, (3 / (z+1))^5, type="b", xlab=expression(theta), ylab=expression(paste("P(",theta,")")))

z您只需生成已有的点,然后将它们与一组零连接起来

z <- seq(20, 50, by=1)
y <- (3 / (z+1))^5

z <- c(1:20,20:50)
y <- c(rep(0, 20), y)
plot (z, y, xlab=expression(theta), type="b",
    ylab=expression(paste("P(",theta,")")))
z