如何将特定点(我已经制作了不同的颜色)带到 R 散点图的前面?

How do I bring a specific point (that I've made a different color) to the front of and R scatter plot?

我在 R 中使用以下方法绘制了散点图:

par(mfrow=c(1,2))
plot(x2~x1, pch=20, col=df$colour, cex=1.5, xlim=c(-4,16), ylim=c(-4,16))
with(df, text(x2~x1, labels = df$gene, pos = 4))
plot(x4~x3, pch=20, col=df$colour, cex=1.5, xlim=c(-4,16), ylim=c(-4,16))
with(df, text(x4~x3, labels = df$gene, pos = 4))

我得到了接近我想要的东西,但我希望红色兴趣点位于第二张图像中的堆栈顶部。我已经尝试重新排序数据帧以在数据帧中的第一个和最后一个点都有单点,但它不会改变图像,感兴趣的点仍然隐藏在第二个图中。任何帮助将非常感激。谢谢!

调用绘图后使用points添加点:

y1 <- x1[df$coulour=="red"]
y2 <- x2[df$coulour=="red"]
y3 <- x3[df$coulour=="red"]
y4 <- x4[df$coulour=="red"]

par(mfrow=c(1,2))

plot(x2~x1, pch=20, col=df$colour, cex=1.5, xlim=c(-4,16), ylim=c(-4,16))
points(y2~y1, pch=20, col="red", cex=1.5)
with(df, text(x2~x1, labels = df$gene, pos = 4))

plot(x4~x3, pch=20, col=df$colour, cex=1.5, xlim=c(-4,16), ylim=c(-4,16))
points(y4~y3, pch=20, col="red", cex=1.5)
with(df, text(x4~x3, labels = df$gene, pos = 4))