Я хотел бы нарисовать полую гистограмму, в которой нет вертикальных полос, внутри которой она находится, а всего лишь контур. Я не мог найти способ сделать это с помощью geom_histogram
. Комбинация geom_step
+ stat_bin
выглядела так, будто она могла выполнять эту работу. Тем не менее, бины geom_step
+ stat_bin
сдвигаются на половину бина вправо или влево, в зависимости от значения параметра шага direction=
. Похоже, он делает свои "шаги" в центрах WRT. Есть ли способ изменить это поведение, чтобы он выполнял "шаги" на краях корзины?
Вот иллюстрация:
d <- data.frame(x=rnorm(1000))
qplot(x, data=d, geom="histogram",
breaks=seq(-4,4,by=.5), color=I("red"), fill = I("transparent")) +
geom_step(stat="bin", breaks=seq(-4,4,by=.5), color="black", direction="vh")