0

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!

AliN
  • 3
  • 1

1 Answers1

0

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

dcarlson
  • 10,936
  • 2
  • 15
  • 18
  • Sorry - I'm having real problems with formatting the code block :o/ - steep learning curve. library(rgl) plot3d(x = mtcars$wt, y = mtcars$qsec, z = mtcars$mpg, type = 's', colour = 'green', xlim = c(min(mtcars$wt)-1, max(mtcars$wt)+1), ylim = c(min(mtcars$qsec)-1, max(mtcars$qsec)+1), zlim = c(min(mtcars$mpg)-1, max(mtcars$mpg)+1), xlab = 'Weight', ylab = 'Qsec', zlab = 'MPG') – AliN May 20 '20 at 17:23
  • Sorry - I couldn't work out how to format the code as a code block. Very new to all of this – AliN May 20 '20 at 17:24
  • Change `colour="green` to `col="green`. Always check the manual page `?plot3d` when you are having problems to make sure you have the arguments specified correctly. – dcarlson May 20 '20 at 18:15
  • Thank you so much! – AliN May 20 '20 at 19:01