Have you tried using the same files and same tools used to create the first image that you posted?
You can create the image on the right using ChIPSeeker
I also used a tweak by using the tagmatrix from ChIPSeeker and plotting the number of tags to get something similar to your graph on the left. here's the code, it starts from a bed-formatted file. I used it with ENCODE data and it works as expected.
library(ChIPseeker); library(TxDb.Hsapiens.UCSC.hg19.knownGene)
# get TSS info
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
promoter <- getPromoters(TxDb=txdb, upstream=2000, downstream=2000)
#read data
data<- readPeakFile(peakfile = "data.narrowPeak")
# get tag matrix
tagMatrix <- getTagMatrix(data, windows=promoter)
# calculate how many tags you have at each position
tags <- c()
for(i in 1:dim(tagMatrix)[2]){
tags <- c(tags, sum(tagMatrix[,i]))
}
# plot it
plot(tags, type="n", ylim=c(0, 120), frame.plot=F, xlab="", ylab="Binding",xaxt="n")
axis(1, at=seq(0, 4000, 1000),labels=c("","","","",""),col.axis="black", las=2, cex.axis=1.2, tck=-.01)
mtext(side=1,text=c("-2kb", "-1kb", "TSS", "+1kb", "+2kb"), at=seq(0, 4000, 1000), line=0.4)
mtext(side=1,text=("Distance to TSS"), at=2000, line=2, cex=1.4)
lines(tags, col="blue", lwd=5)