Re: [R] mtext in barplot

2009-04-06 Thread Jim Lemon

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.

...
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...
  

Hi John,
The horizontal bar positions are returned invisibly by the barplot 
function, so:


xpos-barplot(...)
mtext(side=1,at=xpos,...)

should do what you want.

Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] mtext in barplot

2009-04-05 Thread johnhj

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...

Can anybody help me please ?

greetings,
johnh
-- 
View this message in context: 
http://www.nabble.com/mtext-in-barplot-tp22893563p22893563.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] mtext in barplot

2009-04-05 Thread Uwe Ligges



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


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.