Re: [R] using the stepfun to plot histogram outline.

From: hadley wickham <>
Date: Sat, 21 Jun 2008 10:21:01 -0500

On Sat, Jun 21, 2008 at 3:36 AM, Karin Lagesen <> wrote:
> Hello list:)
> I have lots of values which I would like to get a histogram outline
> out of.
> An example of what I am talking about:
> testdata = runif(100)
> bbb = seq(0,1, by = 0.01)
> hist(testdata, breaks = bbb)
> I would like to get the outline of the resulting histogram.

Do you want to draw the outline, or create a function that represents it? (that's what stepfun will do) Either way looking at:

h <- hist(testdata, breaks = bbb)

will probably be helpful.



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 21 Jun 2008 - 16:00:43 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 Sat 21 Jun 2008 - 16:30:48 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive