1
votes

is it possible to change the thickness of the ellipses (incl circle) in ggbiplot? The arguments don't seem to have that option. Is there another way around it? So far I've dealt with this issue by making my data points more transparent.

2
Which package is this function from?Roland
ggbiplot is a packageval

2 Answers

2
votes

I assumed you got a recent version of ggbiplot from github (19 Jun 2015 https://github.com/vqv/ggbiplot). In this one, the circle thickness is hard-coded, but you can modify the code easily. The parameter in question is set here (around line 86 in the definition of ggbiplot()):

if (circle) {
      theta <- c(seq(-pi, pi, length = 50), seq(pi, -pi, 
                                                length = 50))
      circle <- data.frame(xvar = r * cos(theta), yvar = r * 
                             sin(theta))
      g <- g + geom_path(data = circle, color = muted("white"), 
                         size = 1/2, # <= MODIFY HERE
      alpha = 1/3)
        }
0
votes

Copying the ggbiplot code into a new function and changing it works, but the change in line 87 only works if var.axes = TRUE, which is the default. If you set var.axes = FALSE then you need to add a size parameter to the call in line 124. Something like g <- g + geom_path(data = ell, aes(color = groups, group = groups),size=2).