Skip to content
Back to formatted view

Raw Message

Message-ID: <49D8D1AB.2050808@statistik.tu-dortmund.de>
Date: 2009-04-05T15:43:39Z
From: Uwe Ligges
Subject: mtext in barplot
In-Reply-To: <22893563.post@talk.nabble.com>

johnhj wrote:
> Hii,
> 
> Can anybody help me to put a text under the barplots. I will describe the
> percental between six grouped barplots. I tried to do it with mtext but
> without success.
> 
> Here is my code:
> 
> test <-read.table(file="D:/mobile.txt")
> 
> pdf(file = "D:/mobil126.pdf",
>     width = 6.67, height = 5, onefile = TRUE, family = "Helvetica",
>     title = "R Graphics Output", fonts = NULL, version = "1.1",
>       bg="white", pointsize=10)
> 
> barplot(as.matrix(test), main="OLSR",xlab="Hops",
> col=c("skyblue1","salmon"),width<-
> c(1,1),names=c("2->1","4->2","3->1","2->1","2->1","1->2"),  legend =
> rownames(x), beside=TRUE)
> 
> legend("topright", c("OLSR"),cex=0.8,ncol =1.5,col =
> c("red"),bg=c("lightskyblue1"))
> 
> dev.off()
> 
> 
> I tired to do it with 
> mtext(side=1,at=x, text =c("Mean", "","","","","rere"), col = "red"),
> line = 1, cex = 0.75) but without success, I get this example from a R
> tutorial...


What is x? The bars in a barplot are at locations 1:n.

Uwe Ligges


> Can anybody help me please ?
> 
> greetings,
> johnh