Given this example of back to back histogram:
set.seed (123)
xvar <- round (rnorm (100, 54, 10), 0)
xyvar <- round (rnorm (100, 54, 10), 0)
myd <- data.frame (xvar, xyvar)
valut <- as.numeric (cut(c(myd$xvar,myd$xyvar), 12))
myd$xwt <- valut[1:100]
myd$xywt <- valut[101:200]
xy.pop <- data.frame (table (myd$xywt))
xx.pop <- data.frame (table (myd$xwt))
library(plotrix)
par(mar=pyramid.plot(xy.pop$Freq,xx.pop$Freq,
main="Population Pyramid",lxcol="blue",rxcol= "pink",
gap=0,show.values=F))
Is it possible to change the shape of the bars so that they are simply lines, something like:
Your code is obfuscating to me what your final result is supposed to be exactly. Maybe this: