[R] ggplot barchart: bars don't stock on breaks
boris.steipe at utoronto.ca
Mon Jan 12 15:03:54 CET 2015
Barcharts are for categorical data, the axis only serves to organize the category labels. From the sound of it, you are looking for a histogram.
Hope this helps,
On Jan 12, 2015, at 8:31 AM, najuzz <mjoey at gmx.de> wrote:
> Hi guys, I have the following weired problem. I just want a simple barchart,
> but the visuals are different from what I expect.
> ggplot(x,aes(xx))+geom_bar(binwidth = 0.5)
> I don't know if you can see the image so here is a description of my
> problem: the bars should be centered around O and 1, however both bars begin
> to the right of 0 and 1, so in this case with binwidth= 0.5 they range from
> 0 to 0.5 and 1 to 1.5.
> How can I fix this?
> Thank you,
> View this message in context: http://r.789695.n4.nabble.com/ggplot-barchart-bars-don-t-stock-on-breaks-tp4701665.html
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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