如何在热量上绘制R图以绘制变量

时间:2016-10-24 04:59:33

标签: r plot

我在R中绘制数据。我正在运行以下两个命令:

plot(x = df$Latitude, df$Longitude, col = heat.colors(nrow(df)), type = "p")

plot(x = df$Latitude, df$Longitude, col = df$feature, type = "p")

第一行沿着颜色渐变绘制点(具有较高值的​​点为红色,具有较低值的点为黄色),第二行绘制具有由features给出的int值指示的颜色的数据。

但是,我希望将两者结合使用,以便使用feature中的数值在刻度上绘制颜色点。在某种意义上,我想将两个参数传递给col。我怎么能这样做?

1 个答案:

答案 0 :(得分:1)

您可以尝试:

<i class="fa fa-copyright fa-flip-horizontal"></i>

enter image description here

对于图例,请参阅解决方案herehere