1
我有一個類似的問題,也提出了在這裏:How to merge color, line style and shape legends in ggplotggplot合併兩個疊加圖的形狀在傳說
我想從虹膜數據集與我進行了聚類在一起繪製物種。爲簡單起見,我們假設通過
c(rep(1,45),rep(2,59),rep(3,46)))
不知何故給出的集羣IST,從上面引述的帖子建議不要對我
library(ggplot2)
library(scales)
ggplot(iris, aes(Petal.Length, Petal.Width, color = Species)) +
geom_point(shape = 18, size = 7) +
geom_point(shape = 15, size = 3,data = iris,
aes(iris$Petal.Length, iris$Petal.Width,
color = as.factor(c(rep(1,45),rep(2,59),rep(3,46))))) +
scale_color_manual(values=rep(alpha(c("#00B6EB","#F8766D", "#53B400"),0.5),2)) +
scale_shape_manual("",values=c(18,18,18,15,15,15))
在傳說中的工作,我想塑造15(盒)用於物種的羣集1,2,3和18(鑽石)。
感謝您爲您的文章,那肯定的作品。如何更簡單的解決方案(請參閱我的文章和引用的帖子)不起作用? – Dan