根据值的增加或减少来改变点的颜色

时间:2017-05-14 20:59:51

标签: r if-statement plot

在Plots中我试图使用pch = ifelse,但我不确定如何测试条件。

settings.py

我想根据它们的增加或减少来改变点的形状(或颜色)。

1 个答案:

答案 0 :(得分:3)

第一点使用pch = 1

plot(x, y, pch = c(1, ifelse(y[-1] < y[-length(y)], 8, 0)))

enter image description here

相关问题