本文介绍了当数据不在常规网格上时,如何画出轮廓图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 假设我有3个变量,使得 x = 1:9 y = c(1,1, 1,2,2,2,3,3,3)z = 6:14 如何重新排列数据,以便我可以用r来形成数据的轮廓图? 我收到消息 contour.default(x,y,z)中的错误:增加'x'和'y'值预期 谢谢。解决方案 z 是一个矩阵绘制轮廓线。 x 和 y 是他们各自的位置。在r-help邮件列表中泰勒解释这一点,并给出如何转换数据以使事情发挥作用的示例。另请参见?轮廓的帮助中的示例。 x = seq (0,10,by = 0.5)y = seq(0,10,by = 0.5)z 轮廓(x,y ,z) Say I have 3 variables such that x=1:9y=c(1,1,1,2,2,2,3,3,3)z=6:14How can I rearrange the data so that I can make a contour plot of the data with r? I am getting the messageError in contour.default(x, y, z) : increasing 'x' and 'y' values expectedThank you. 解决方案 z is a matrix of values where contour lines are to be drawn. x and y are their respective location. "Tyler" at r-help mailing list explains this and gives an example of how to transform your data to make things work. See also examples in the help of ?contour.x = seq(0, 10, by = 0.5)y = seq(0, 10, by = 0.5)z <- outer(x, y)contour(x, y, z) 这篇关于当数据不在常规网格上时,如何画出轮廓图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 09:06