[R] Histograms with bin proportions on the y-axis

R. Michael Weylandt michael.weylandt at gmail.com
Sun May 20 22:45:34 CEST 2012


To open a graphics device, you usually use a function like png() or
eps() then do your plotting then dev.off() to close it when you're
done.

Sounds like you need something like hist(x, breaks = 100, freq = TRUE)

Hope that helps,

Michael

On Sun, May 20, 2012 at 3:07 PM, Nick Gayeski
<nick at wildfishconservancy.org> wrote:
> I have what is probably a simple problem. I have a data file from an MCMC
> Bayes estimation problem that is a vector of 500,000 numeric values (just
> one variable) ranging from 100,000 to 700,000. I need to display the
> histogram of this data in a high quality graphic for a figure in a journal
> publication. I want 100 bins so as to display a reasonable complete and
> smooth histogram, and I need the Y-axis to display the bin proportions.
>
> I'm new to all of the graphics capabilities of R.
>
> Can anyone provide me with the command I need to issue to the call to hist
> to get the output that I desire?
>
>  I assume that once I have the desired histogram I will be able to save it
> in a format like .eps that will permit it to be reproduced in high
> resolution. But any suggestions for this task would also be appreciated.
>
> Regards,
>
> Nick
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.



More information about the R-help mailing list