I was trying to plot a phylogeny tree along with bar plot side by side. I am using the following code. The problem is that my bar plot extend outside the right margin. Any help is appreciated. Thanks in advance.
TREE <- rcoal(10)
tip.order <- TREE$tip.label[TREE$edge[TREE$edge[, 2] <= Ntip(TREE), 2]]
data<-matrix(seq(1:10),nrow = 10,ncol = 1,byrow = T)
rownames(data)<-apply(data,1, function(x) paste('t',x,sep = ''))
barplot(c(NA,dordered),add=T,horiz = T,space = 0,offset = 1.4,axes = F,axisnames = F,width = 0.95,xlim = (0:10),par(pin=c(1,8)))
axis(1,lab + 1.2,label=lab,cex.axis=0.4,padj=0)