【发布时间】:2016-09-15 10:34:35
【问题描述】:
如何为一个直方图指定 bin 宽度?
library(GGally)
data(tips, package="reshape")
library(ggplot2)
ggpairs(data=tips, # data.frame with variables
columns=1:3, # columns to plot, default to all.
title="tips data", # title of the plot
mapping=aes(color=sex)) # aesthetics, ggplot2 style
【问题讨论】:
-
最简单的方法是改变ggmatrix。即
gg <- ggpairs(...,然后是gg[3,1] <- gg[3,1] + geom_histogram( binwidth = 50) ; gg -
如果您只想在一个方面进行更改,请按照stackoverflow.com/questions/17271968/… 的行覆盖该单元格