The boxes plotted by the following code are very narrow. If I'm not
mistaken, I think that it is because to neighboring x locations are
too close to each other, and the width of the boxes is smaller than
the closest distance between two neighboring positions. I'm wondering
if there is a way to make the boxplot wider, even if there are
overlaps between boxes.
library(ggplot2)
dframe=data.frame(
x=do.call(
c
, lapply(
0:10
, function(i) {rep(i*1000,10)}
)
)
, y=do.call(
c
, lapply(
0:10
, function(i) {rnorm(10,i)}
)
)
)
dframe=rbind(
dframe
, data.frame(
x=rep(-1,10)
, y= rnorm(10,-1)
)
)
qplot(x,y,data=dframe,geom='boxplot', group=round(x))
--
Regards,
Peng
you can set the width of box like this:
ggplot(dframe, aes(x,y,group=round(x))) + geom_boxplot(width=1)
--
Kohske Takahashi <takahash...@gmail.com>
Research Center for Advanced Science and Technology,
The University of Tokyo, Japan.
http://www.fennel.rcast.u-tokyo.ac.jp/profilee_ktakahashi.html
> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>