Trying to remove the gridlines and background in a PCA using ggbiplot in R

716 Views Asked by At

I have made a PCA in R using

ggbiplot(PCA.model,ellipse=TRUE,labels=PCA_data
     $label,groups=PCA_data$Month)

[image of PCA][1]

but i need to remove the grey and the gridlines. I have tried solutions on here but nothing has worked so far.

I have tried this and various other themes but no luck.

ggbiplot(PCA.model,ellipse=TRUE,labels=PCA_data
    $label,groups=PCA_data$Month, frame.colour = NULL) 
      $label,groups=PCA_data$Month) + theme_classic()

Any ideas? :) [1]: https://i.stack.imgur.com/ADIn9.png

1

There are 1 best solutions below

0
On

it works for me with the following commands:

  • theme_set(theme_bw()) + theme( plot.background = element_blank(), panel.grid.major = element_blank(), panel.grid.minor = element_blank())

theme_set(theme_bw()) #To make the gray background white

theme( plot.background = element_blank(), panel.grid.major = element_blank(), panel.grid.minor = element_blank()) #Eliminate the grids