rxquartz

XQuartz plots not in colour using R on mac


I'm very new to R so please forgive any lack of knowledge. I am doing a course which needed the package rgl and managed to work out (finally) that I needed to install XQuartz - which I have done. It is working but I can't get the plots to show in colour - they are only in black and white. Does anyone know what I'm doing wrong / how to fix it? I've tried looking at the XQuartz documentation but can't work it out.

Thanks!


Solution

  • You need to provide a reproducible example, including your code. I am having no difficulty getting color on my XQuartz device:

    set.seed(42)
    x <- runif(10)
    y <- runif(10)
    plot(x, y, pch=21, bg=2:6, cex=3)
    

    Plot