# Re: [R] Ploting Histogram with Y axis is percentage of sample for each bin

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Thu, 03 Mar 2011 16:36:24 -0600

On Mar 3, 2011, at 12:44 PM, leinwand wrote:

> I'm trying to do something very simple...
>
> I wan to plot a histogram where the y axis represent the percentage
> of the
> total sample that each bin represents.
>
> I know how to plot a histogram with the counts and density... but
> can't find
> anything that gives me perenct of sample on the y axis.
>
> Any help is appriciated
>
> Below is the script I'm working with
>
> par(mfrow=c(1,2))
> hist(ISIS\$ASH_BA1K_ISIS[ISIS\$Pest_Status=="-1"], main="Ash BA 1K
> Negative
> Detection", xlab="ASH BA 1K")
> lines(density(ISIS\$ASH_BA1K_ISIS), col="blue")
> hist(ISIS\$ASH_BA1K_ISIS[ISIS\$Pest_Status=="1"], main="Ash BA 1K
> Positive
> Detection", xlab="Ash BA 1K")
> lines(density(ISIS\$ASH_BA1K_ISIS), col="red")

Script but no data.

There is a pretty much identical question asked and answered earlier today... despite the fact theat the OP doesn't seem to undersatnd or be able to apply the directions, you should see if the thread "Probabilities greather than 1 in HIST" answers your question.

>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Ploting-Histogram-with-Y-axis-is-percentage-of-sample-for-each-bin-tp3333961p3333961.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

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 Thu 03 Mar 2011 - 22:38:48 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 Thu 03 Mar 2011 - 22:40:19 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.