Hi, I know how to plot an histogram and how to add a density line. But how can I plot only the density line without the bars? Is there a way to say the hist() function not to plot bars, but a density line instead?
plot(density(x)) Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Thu, Oct 16, 2008 at 10:54 PM, J?rg Gro? <joerg at licht-malerei.de> wrote:> Hi, > > I know how to plot an histogram and how to add a density line. > But how can I plot only the density line without the bars? > > Is there a way to say the hist() function not to plot bars, but a density > line instead? > > ______________________________________________ > 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. >
Jörg Groß
2008-Oct-16 15:54 UTC
[R] histogram without bars but with density line - frequency-lines?
Am 16.10.2008 um 17:12 schrieb Yihui Xie:> plot(density(x)) > > Regards, > Yihui > --Thanks! Is there also a way to plot the frequency-bars (not the density) as lines instead of bars?
Yihui Xie
2008-Oct-17 05:59 UTC
[R] histogram without bars but with density line - frequency-lines?
Bars are corresponding to bins, and the bin-width for lines is 0; please tell me what is the "frequency" at a fixed point (rather than over an interval)? Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Thu, Oct 16, 2008 at 11:54 PM, J?rg Gro? <joerg at licht-malerei.de> wrote:> > Am 16.10.2008 um 17:12 schrieb Yihui Xie: > >> plot(density(x)) >> >> Regards, >> Yihui >> -- > > Thanks! > > Is there also a way to plot the frequency-bars (not the density) as lines > instead of bars? > > ______________________________________________ > 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. >