我想在R图中为一个区域着色,类似于下面链接中的图片。谁能帮到我这方面的帮助。 这是数据:
x=c(1.864465, 1.827621, 1.826651, 1.861554, 1.913762, 1.947597, 2.000194, 2.088858, 2.122402, 2.211357, 2.299051, 2.369923, 2.476087, 2.56446, 2.671303, 2.705721, 2.794287, 2.865063, 2.881787, 2.934675, 3.113458, 3.18404, 3.29098, 3.559398, 3.66692, 3.809539, 3.952352, 4.094875, 4.291546, 4.577658, 4.702389, 4.899254, 5.275486, 5.49053, 5.813291, 6.01006, 6.170955, 6.349642, 6.438112, 6.509179, 6.597842, 6.7042, 6.774588, 6.790923, 6.896699, 6.949102, 7.073542, 7.179996, 7.232496, 7.320772, 7.481861, 7.660839, 7.785667, 7.909719, 7.837196, 7.710524, 7.584046, 7.349561, 7.186822, 6.933769, 6.645134, 6.464313, 6.3555296.120558 6.047648 5.956655 5.794013 5.667244 5.594721 )
y=c(9.97042, 9.866379, 9.75064, 9.623202, 9.414684, 9.159933, 8.99771, 8.846937, 8.557464, 8.441412, 8.1749, 8.047337, 7.838631, 7.653136, 7.525448, 7.34014, 7.177793, 7.038656, 6.888133, 6.760632, 6.632694, 6.470409, 6.354295, 6.191324, 6.144653, 5.993693, 5.86588, 5.703345, 5.563771, 5.366015, 5.226691, 5.110265, 4.935344, 4.842003, 4.72514, 4.59714, 4.480838, 4.341327, 4.167406, 4.06299, 3.912217, 3.72666, 3.541227, 3.344408, 3.089407, 2.904036, 2.72999, 2.556007, 2.38221, 2.185141, 2.091988, 1.987198, 1.859448, 1.639106, 1.569912, 1.477758, 1.408751, 1.328546, 1.224942, 1.075355, 0.972189, 0.857074, 0.7532840.615208 0.499719 0.372718 0.280689 0.17696 0.107767 )
par(xaxs="i", yaxs="i")
plot(x,y)
答案 0 :(得分:0)
尝试polygon
功能,例如:
polygon(x=c(0:5, rev(0:5 )), y=c(rep(0, 6), rep(4,6)), density=10, angle=45)