ggplot2:R 语言中用于数据可视化的绘图包,基于“图形语法(Grammar of Graphics)”思想,通过分层(layers)方式构建图形,常用于统计图表与数据探索。(也可泛指用该包制作的图表风格与生态。)
/ˌdʒiː dʒiː ˈplɑːt tuː/
I made a scatter plot in ggplot2.
我用 ggplot2 做了一张散点图。
Using ggplot2, we can map variables to color and size, then add layers like smoothing lines to reveal patterns in the data.
使用 ggplot2,我们可以把变量映射到颜色和大小上,再添加平滑线等图层,从而更清晰地发现数据模式。
ggplot2 来自 ggplot(即 Grammar of Graphics plot,“图形语法绘图”)加上版本号 2。它由 Hadley Wickham 主导开发,强调用“映射(aesthetics)+ 几何对象(geoms)+ 统计变换(stats)+ 坐标系(coords)+ 分面(facets)”等组件分层组合来生成图形。