0

I have produced the following graph with this code:

png(file = "/home/tania/Desktop/internship_graph_mount/Results/bp.enrich.humanonly.top.stemness.png", width = 50*300, height = 60*300, res = 300)
par(mar=c(20, max(nchar(colnames(humanonlya)))+75, 20, 5))
barplot(humanonlya, horiz = T, beside=T, las=1, space = c(60/ncol(humanonlya),60/ncol(humanonlya)), col=colorRampPalette(c("red"))(n=1), cex.names=4.5, axes=F, xlim=c(0,10))
title(main = list("Biological Processes - human only", cex = 5), adj= 0, line=-1)
axis(side=1, at=seq(from=0,to = 10, by=2),cex = 5,lwd=4, xlab="-log10(FDR)", xlim=c(0,10), cex.axis=2.5, mgp=c(2,1,0))
dev.off()

enter image description here

I would like to bring the horizontal axis closer to the lower column. How could I do that?

salamandra
  • 33
  • 1
  • 8
  • 1
    don't plot it with `barplot` but add it afterwards with `axis` and use parameter `line` to control where you want it – Cath Jul 13 '18 at 10:41
  • I added afterwards, and also tried changing line valie, but it didn't work... – salamandra Jul 13 '18 at 10:56
  • please provide a [mcve] so it can be easier to help – Cath Jul 13 '18 at 11:03
  • 1
    for example, `barplot(1:5, horiz=TRUE, axes=FALSE); axis(1, line=-3)` will draw the axis inside the lower bar... In your call to `axis` you're not setting `line` value – Cath Jul 13 '18 at 11:05
  • 1
    you were right! i though line could only have -1, 0 and 1, but with -10 it worked fine. thank you! – salamandra Jul 13 '18 at 11:15

0 Answers0