これは、 R および ggpairs のユーザー定義カラー パレットと同じ質問 ですか、またはggplot を使用して GGally::ggpairs のカラー パレットを変更する方法はありますか?
そこにあるソリューションが機能しなくなっただけです。
カラーパレットも変更したいのですが、ggplotを使ってGGally::ggpairsのカラーパレットを変更する方法はありますか?もう機能しません。何をすべきか?
MWE:
library(GGally)
library(ggplot2)
data(diamonds, package="ggplot2")
diamonds.samp <- diamonds[sample(1:dim(diamonds)[1],200),]
ggpairs(
diamonds.samp[,1:2],
mapping = ggplot2::aes(color = cut),
upper = list(continuous = wrap("density", alpha = 0.5), combo = "box"),
lower = list(continuous = wrap("points", alpha = 0.3), combo = wrap("dot", alpha = 0.4)),
diag = list(continuous = wrap("densityDiag")),
title = "Diamonds"
)
追加したい
scale_colour_manual(values=c('red','blue','green','red','blue'))
(明らかにそれは単なるダミーコードです)そして次のようなものを取得します(すべてのドットを塗りつぶしたわけではありません):