[R] Histogram

R Help rhelp.stats at gmail.com
Thu Jun 9 14:27:45 CEST 2011


It's difficult to understand what exactly you're looking for without
seeing an example, could you post a simple version?  imgur.com is a
website that lets you quickly upload pictures to share with others.

I think your problem can be solved with the type='s' option to the
general plot routine.  Consider the following three plots, I think the
third is the one you're looking for.

x = runif(10,0,1)
x2 = cumsum(x)

plot(x2)
plot(x2,type='l')
plot(x2,type='s')

Hope that helps,
Sam Stewart

On Thu, Jun 9, 2011 at 9:15 AM, Anupam <anupamtg at gmail.com> wrote:
> Nice graphs there. Thanks. I too am looking to make a similar plot, with a
> difference: I need only the top parts of the many 'histograms' (a
> step-function like plot for histogram/bar-plots). I already have values for
> "heights" of bars for x1-x2 intervals computed from a large survey data; I
> want steps to be left-continuous; and step-functions to be plotted with
> different lines and symbols for each of many groups.
>
> I also want to make similar plots for cumulative 'histograms/bar-plots' to
> compare groups. I have "cumulative heights" for x1-x2 intervals,
> left-continuous.
>
> Any idea how to do this?
>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
> Behalf Of Steven Kennedy
> Sent: Thursday, June 09, 2011 3:28 AM
> To: nandini_bn
> Cc: r-help at r-project.org
> Subject: Re: [R] Histogram
>
> Have a look at:
> http://addictedtor.free.fr/graphiques/thumbs.php
>
> One of the graph examples they have is exactly what you are after.
>
>
> On Wed, Jun 8, 2011 at 11:14 PM, nandini_bn <nandini_bn at hotmail.com> wrote:
>>
>> Hello ,
>> I am trying to create a histogram in order to compare between two
>> groups and would like it to be similar to the figure attached. How can
>> I generate this using R ?
>>
>>
>> Thank you,
>> Nandini
>> http://r.789695.n4.nabble.com/file/n3582448/5634-15977-1-PB.gif
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/Histogram-tp3582448p3582448.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.
>>
>
> ______________________________________________
> 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.
>
> ______________________________________________
> 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