R填充轮廓

时间:2020-05-11 16:36:21

标签: r plot contour contourf

我有三个看起来如下的矩阵:

x <- cbind(rep(0,18),rep(100,18),rep(200,18),rep(300,18),rep(400,18))
y <- cbind(seq(500,670,10), seq(510,680,10), seq(520,690,10), seq(530,700,10), seq(540,710,10))
z <- cbind(rnorm(18), rnorm(18), rnorm(18), rnorm(18), rnorm(18))

当我尝试使用fill.contour和

绘制它们时
filled.contour(x,y,z)

我收到错误

Error in filled.contour(x, y, z) : increasing 'x' and 'y' values expected

我猜这里的问题是每列中都有重复的x值。但是我需要这种布局,因为我在一个x值(x =距离,y =高度)上沿着y值线有一个z值。有没有一种方法可以使用fill.contour或Contourff在轮廓图中绘制这些数据?

0 个答案:

没有答案