It required some changes to geom_crossbar; instead of drawing the body with a GeomRect, it now uses GeomPolygon.As usual, comments and suggestions are welcome!-Winston
Have you tested it into non-Cartesian coordinates?
On Wed, Dec 7, 2011 at 12:42 PM, Winston Chang <winsto...@gmail.com> wrote:
Have you tested it into non-Cartesian coordinates?
I just tried testing the unmodified geom_boxplot code (the lastest version from master), and I get weird results. It's hard for me to say what should happen with notch and log together, given that without notch, the results are strange.These examples are made with the version from the master branch:ggplot(dat2, aes(x=x, y=y)) + geom_boxplot()
ggplot(dat2, aes(x=x, y=y)) + geom_boxplot() + scale_y_log10()
It looks like the whiskers are undergoing some sort of transformation, but the boxes aren't.
Now I'm starting to remember the hideous complexity of boxplots - I think currently those bits were special cased for transformation - or maybe it's an aesthetic that starts with x or y? I think whiskermin probably needs to be named to xwiskermin for it to work.
Working means that qplot(x, y) + scale_y_log10() is identical to
qplot(x, log10(y)), modulo the axes.
But thinking about it more, the transformation happens before
stat_boxplot see's the code, so you shouldn't have to do anything.
Working means that qplot(x, y) + scale_y_log10() is identical toqplot(x, log10(y)), modulo the axes.
But thinking about it more, the transformation happens before
stat_boxplot see's the code, so you shouldn't have to do anything.
Ok, great. What about with coord_polar or coord_transform? Those
will test that you've constructed the final grob appropriately.
Would you also mind taking a look at
https://github.com/hadley/ggplot2/issues/108 ? It might be the same
problem as https://github.com/hadley/ggplot2/issues/281
On Wed, Dec 7, 2011 at 2:51 PM, Winston Chang <winsto...@gmail.com> wrote:Ok, great. What about with coord_polar or coord_transform? Those
>> Working means that qplot(x, y) + scale_y_log10() is identical to
>> qplot(x, log10(y)), modulo the axes.
>>
>> But thinking about it more, the transformation happens before
>> stat_boxplot see's the code, so you shouldn't have to do anything.
>>
>
> In that case, I think everything works. These all look the same (except that
> the notch versions have notches, of course):
will test that you've constructed the final grob appropriately.
ggplot(dat2, aes(x=x, y=log10(y))) +geom_boxplot(notch=TRUE) + geom_point(shape=21, colour="red")ggplot(dat2, aes(x=x, y=y)) + coord_trans(y="log10") +geom_boxplot(notch=TRUE) + geom_point(shape=21, colour="red")
ggplot(dat2, aes(x=x, y=log10(y))) +geom_boxplot(notch=TRUE) + geom_point(shape=21, colour="red")
ggplot(dat2, aes(x=x, y=y)) + coord_trans(y="log10") +geom_boxplot(notch=TRUE) + geom_point(shape=21, colour="red")
Just noticed that the lower whisker for B is different between the coord_trans(y="log10") version and the other log10 graphs. Again, this looks like an issue on the master branch. Here comes another bug report...