ggplot2绘图系统--几何对象之直方图.密度图 1.直方图 参数. geom_histogram(mapping = , data = , stat = 'bin', #统计变换,概率密度为density position = 'stack', binwidth = , #条柱宽度 bins = , #条柱数目,默认30 na.rm = FALSE, show.legend = NA, inherit.aes = TRUE ) 示例. ggplot(diamonds,aes(carat))+