[R] How to change labels in a histogram

S Ellison S.Ellison at lgc.co.uk
Tue Jul 8 13:53:13 CEST 2008


>>> Lord Yo <nabble at sporez.com> 07/08/08 9:00 AM >>>
>I am trying to add a percent sign to my labels in a hist() plot. 

?hist says "labels: logical or character. " This should be a clue;
labels could be a character vector.

Try
x<-rlnorm(128, 1)

h<-hist(x,  plot=F)
plot(h, labels=paste(round(100*h$counts/sum(h$counts),1),"%",sep=""))

Steve E

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list