当前的ggbi图(下面的代码)显示X轴值从-5到5,Y轴从-4到4。如何将它更改为X轴值从-6到6,Y轴从-6变为6?
谢谢。
代码:
library(devtools)
install_github("ggbiplot", "vqv")
library(ggbiplot)
data(wine)
ggbiplot(wine.pca, obs.scale = 1, var.scale = 1, group=wine.class,
varname.size = 8, labels.size=10,
ellipse = TRUE, circle = TRUE) +
scale_color_discrete(name = '') +
geom_point(aes(colour=wine.class), size = 8) +
theme(legend.direction ='horizontal',
legend.position = 'top')发布于 2014-06-08 09:12:59
一种可能性:使用xlim和ylim岩藻
library(ggbiplot)
data(wine)
wine.pca <- prcomp(wine, scale. = TRUE)
p <-
ggbiplot(wine.pca, obs.scale = 1, var.scale = 1, group=wine.class,
varname.size = 8, labels.size=10,
ellipse = TRUE, circle = TRUE) +
scale_color_discrete(name = '') +
geom_point(aes(colour=wine.class), size = 8) +
theme(legend.direction ='horizontal',
legend.position = 'top')
p <- p + xlim(-6, 6) + ylim(-6, 6)
print(p)https://stackoverflow.com/questions/24104503
复制相似问题