Help with margins

ggplot2

#1
library(devtools)
install_github("vqv/ggbiplot")
library(ggbiplot)
data(clado2)
clado2.pca <- prcomp(clado2, scale. = TRUE)
ggbiplot(clado2.pca, obs.scale = 1,var.scale = 1, varname.abbrev = FALSE, ellipse = TRUE, circle = TRUE) + scale_color_discrete(name = '') + theme(legend.direction = 'horizontal', legend.position = 'top')

have been using this code to produce the below figure, but i cannot figure out how to adjust the left margin so that it does not cover the labels? could anyone help, ive tried everything


#2

If I understand what you are after, you would like to adjust the x-axis scale so that there is more space on the left for the labels? You can achieve this using ggplot2’s scale_x_continuous function.

I don’t have the data clado2, but using the example code from the ggbiplot GitHub README:

library(ggbiplot)
data(wine)
wine.pca <- prcomp(wine, scale. = TRUE)
ggbiplot(wine.pca, obs.scale = 1, var.scale = 1,
  groups = wine.class, ellipse = TRUE, circle = TRUE) +
  scale_color_discrete(name = '') +
  theme(legend.direction = 'horizontal', legend.position = 'top') +
  scale_x_continuous(limits = c(-5, 5))

Hope this is helpful.