lionel- / ggstance

Horizontal ggplot2 components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

incorporate vertical dodging?

bbolker opened this issue · comments

This package would seem to be a natural home for a position function that allowed vertical dodging, e.g. adapted from

http://www.jaredlander.com/2013/02/vertical-dodging-in-ggplot2/

Hi Ben.

The position stuff is automatically handled in ggstance's horizontal layers. I think that's a more user friendly solution than having to deal with additional positions.

Maybe it's still useful to provide manual vertical dodging but what would be the use cases?

I wanted to create a faceted dot plot like this, but with dodging rather than vertical jittering ... I guess I could use geom_pointrange with zero-length ranges ... ?

dd <- expand.grid(g=c("A long long label","B long long label"),
                  f=c("a","b"),h=c("c","d","e"),rep=1:10)
set.seed(101)
dd$y <- sample(1:4,replace=TRUE,size=nrow(dd))
library(ggplot2)
ggplot(dd,aes(y,g,colour=h))+
    stat_sum(position=position_jitter(width=0,height=0.5))+
                 facet_wrap(~f,ncol=2)

you're right that it would be useful there. I'll see if I can reuse the flipping internals to easily make a position_vdodge(). I'm just a bit worried about confusing users of the horizontal layers, as they could try to use these new positions. Maybe the new vertical positions should be used in those layers then?

Here you go @bbolker

I think I'll drop the automatic conversion strategy in ggstance before the CRAN release. It won't change anything for the default stats, geoms and positions, but when a different component is chosen it will have to be a version provided in ggstance rather than ggplot2. The interface will probably feel less magical this way, and it makes more sense with the new separately flipped positions.

cc @smouksassi who might be interested in these positions.

                                                                                  Dear lionel thanks for keeping me in the loop.I indeed use many for ggstance flipped geom ! Bests,Samer                                                                                                                                                                                                                                                                                                                                        Swipe typed from Blackberry.                                                                                                                                                                                                                From: Lionel HenrySent: Saturday, April 16, 2016 13:30To: lionel-/ggstanceReply To: lionel-/ggstanceCc: Samer MouksassiSubject: Re: [lionel-/ggstance] incorporate vertical dodging? (#4)Here you go @bbolker 

I think I'll drop the automatic conversion strategy in ggstance before the CRAN release. It won't change anything for the default stats, geoms and positions, but when a different component is chosen it will have to be a version provided in ggstance rather than ggplot2. The interface will probably feel less magical this way, and it makes more sense with the new separately flipped positions.

cc @smouksassi who might be interested in these positions.

—You are receiving this because you were mentioned.Reply to this email directly or view it on GitHub