Re: [R] How to change labels in a histogram

From: S Ellison <S.Ellison_at_lgc.co.uk>
Date: Tue, 08 Jul 2008 12:53:13 +0100


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

R-help_at_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. Received on Tue 08 Jul 2008 - 12:09:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Jul 2008 - 12:31:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive