私は ggbiplot() を使用しており、データポイントの色と形状を操作して、よりプリンターに適したものにしたいと考えています。現在、ggbiplot() からデフォルトの虹色を取得しています。引数「+ scale_colour_discrete」と「+ scale_shape_manual」を使用してみましたが、「groups =」引数 ggbiplot がこれらをオーバーライドしているようです。"groups=" 引数を削除すると、楕円を描画できなくなります。「+ テーマ」引数は問題なく機能します。私のコードは以下です。通常の biplot() 関数で色/形状をより簡単に操作できることはわかっていますが、ggbiplot() によって提供される信頼区間の楕円が気に入っています。
g <- ggbiplot(size.pca, choices=1:2, obs.scale = 1, var.scale = 1,
groups=fieldnames, ellipse = TRUE,ellipse.prob=0.68, varname.size=4)
g <- g + scale_colour_discrete(name=" ") #only the name=" " part of this seems to work.
g <- g + scale_shape_manual(values=c(17,16,16,16,16,16), name= " ") #trying to indicate one population different from the rest, but it doesn't seem to do anything (no error either, just no change in the output).
g <- g + theme_bw() +theme(legend.direction = 'horizontal',
legend.position = 'top')
print(g)