Re: [R] Log-scale in histogramm

From: Marc Schwartz <MSchwartz_at_mn.rr.com>
Date: Fri 13 Oct 2006 - 14:28:27 GMT

On Fri, 2006-10-13 at 13:33 +0200, David Graf wrote:
> Hello
>
> My data looks ugly in a normal histogramm. How can I create a
> histogramm with a Y-axis in log-scale?
>
> Thanks for your help!
>
> David Graf

I'm not sure that you want to use a log scale here, but may be better served by log transforming your data.

For example:

# Generate 100 random values from a log normal dist: x <- rlnorm(100)

# Now do a histogram on x
hist(x, freq = FALSE)

# Now use log(x)
hist(log(x), freq = FALSE)

Does that help?

Marc Schwartz



R-help@stat.math.ethz.ch 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 Sat Oct 14 01:11:31 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 13 Oct 2006 - 18:30:09 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.