[R] ggplot barchart: bars don't stock on breaks

najuzz mjoey at gmx.de
Mon Jan 12 14:31:09 CET 2015


Hi guys, I have the following weired problem. I just want a simple barchart,
but the visuals are different from what I expect.

xx<-as.vector(xx)
xx[1:4852]<-0
xx[4853:5941]<-1
table(xx)
x<-data.frame(xx)

ggplot(x,aes(xx))+geom_bar(binwidth = 0.5)

<http://r.789695.n4.nabble.com/file/n4701665/problem.jpeg> 

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,
Johannes



--
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.



More information about the R-help mailing list