【发布时间】:2013-11-14 21:56:29
【问题描述】:
出于布局原因,我想将直方图条放置在标签的中心位置,这样条的中间就位于标签的顶部。
library(ggplot2)
df <- data.frame(x = c(0,0,1,2,2,2))
ggplot(df,aes(x)) +
geom_histogram(binwidth=1) +
scale_x_continuous(breaks=0:2)
这是目前的样子 - 条的左侧位于标签的顶部:
是否可以通过这种方式调整给定的 sn-p? (不使用 geom_bar 代替 f.x.)
【问题讨论】: