R语言 ggplot2 散点图 多组数据 形状,大小,颜色 调整
生活随笔
收集整理的這篇文章主要介紹了
R语言 ggplot2 散点图 多组数据 形状,大小,颜色 调整
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
主要使用的方法就是 scale_shape_manual,scale_size_manual,scale_color_manual,?scale_fill_manual
顏色分為 描變顏色 scale_color_manual 和 填充顏色?scale_fill_manual
重點要注意的是要提前分組,分組的個數和指定參數的個數要相同
ggplot(data, aes(x = numbers, y = length, col = method)) +geom_point()?
ggplot(data, aes(x = numbers, y = length, col = method, shape = method, size = method)) + #col 顏色分組, shape 形狀分組, size 大小分組geom_point()+scale_shape_manual(values = c(1,3,5))+scale_size_manual(values = c(3,4,5))+scale_color_manual(values = c('#E00303','#03E0B6','#E0BF03'))?
總結
以上是生活随笔為你收集整理的R语言 ggplot2 散点图 多组数据 形状,大小,颜色 调整的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 组合数学学习(一)——排列组合和母函数经
- 下一篇: java ssm自行车在线租赁系统ide