1

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.

val
  • 1,629
  • 1
  • 30
  • 56

2 Answers2

2

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)
        }
David Heckmann
  • 2,899
  • 2
  • 20
  • 29
  • thanks. i tried edit(ggbiplot) and changed the 'size' at line 87 plus hit save but it won't take. My guess is that I don't have rights to the folder (corporate machine). So I'd probably have to move the library and relink via .libPath()...argghhh – val Mar 09 '16 at 18:31
  • 1
    just type `ggbiplot` to get the function definition, copy it to your editor, make the modification, and define a new `ggbiplot` function. – David Heckmann Mar 09 '16 at 18:34
0

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).

Cão
  • 521
  • 5
  • 7