In R ggplot, is there a way to create histograms without fill colors and vertical borders between strips?

Like the histogram shown below:

plot
(source: cern.ch )

+5
source share
2 answers

Maybe with geom_step

library('ggplot2')

set.seed(1)
x <- unlist(Map(rpois, 20, 4:1 * 5))
qplot(seq_along(x), x, geom = 'step')

enter image description here

+7
source

A less satisfactory way, using a split black and white black and white photo under one without color with white fill.

set.seed(12)
x <- rpois(1000, 30)

bw <- 2
col <- 'black'
ggplot(data.frame(x), aes(x=x)) + 
    geom_histogram(binwidth=bw, color = col, fill=col, size=2) +
    geom_histogram(binwidth=bw, fill='white') +
    theme_bw()

enter image description here

+6
source

All Articles