サンプルのグループのいくつかの機能をさまざまな美学にプロットしようとしています。円の枠の色と大きさもその一つです。ただし、これらの形状に大きなベースライン境界線を設定しようとすると、 を設定するlwd=2
と、すべての形状が同じサイズに戻り、凡例が表示されなくなります。円の境界線を大きくしたいのですが、どうすればよいですか?
例:
library(ggplot2)
testFrame <- data.frame(
sizeVar=factor(c('a', 'a', 'a', 'a', 'b', 'b', 'b', 'b')),
samples=rep(c('Sample1', 'Sample2'), times=4),
features=c(rep('Feature1', times=4), rep('Feature2', times=4))
)
testPlot <- ggplot(data=testFrame, aes(x=samples, y=features))
testPlot +
geom_point(aes(size=sizeVar), pch=21, color='black', fill='gray') +
scale_size_manual(values=c(9,4)) + theme_bw()
testPlot +
geom_point(aes(size=sizeVar), pch=21, lwd=3, color='black', fill='gray') +
scale_size_manual(values=c(9,4)) + theme_bw()