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

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

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

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}} mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.

list of date sections of archive