-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete the set of horizontal Geoms, Stats and Positions #1128
Conversation
I'm not entirely opposed to this idea, but the implementation seems so inelegant. I wonder if it would be possible to implement a |
I know... At the time I wrote this I've played around with the idea of adding an argument to geoms, but IIRC I encountered some problems that I could not easily solve. Since ggplot is not going to evolve much (or is it?) I thought it may be ok to have all this code repetition. I don't have time to work on another solution however :/ |
I'm going to close this for now, as it just feels a bit too icky (plus no one else has asked for horizontal versions of those geoms). On the plus side, this issue was thought through much more thoroughly in ggvis, and rotating arbitrary geoms is much much easier. |
well the horizontal version of linerange has been asked and is needed for coefficient plots. It's true there is no dire need to merge this since packages and users can implement their own horizontal geoms and colliders (as is currently done e.g. in https://github.com/jaredlander/coefplot/blob/master/R/dodging.r ). |
I merely saw this patch as an easy way to make ggplot2 'complete', and in a way it's not ickier than |
BTW I think we're going to resolve this problem in a more general way - I'm pretty sure we're going to switch to R6 and provide a documented way of adding additional geoms, stats, and position adjustments to ggplot2. Then you can make gghorizontal and we'll both be happy :) |
that's good news! |
so I vote for having the possibility to do it ! |
@smouksassi stay tuned for @lionel-'s gghorizon package ;) |
@smouksassi here is the package https://github.com/lionel-/gghorizon If you have time, could you check it with different combinations of geoms, stats and positions in horizontal layers? |
@lionel- Thanks based on previous posts and requests here is an example: require(gghorizon) set <- factor(rep(1:3, each=50), labels=c("DRUG A","DRUG B","Vehicle")) p <- ggplot(test, aes(subject, result))+ p1 <- ggplot(test, aes(subject, result))+ p1 # works but how to we flip this plot ? p1 +coord_flip() # wrong output incorrect y axis labels #trying the new geom geom_boxploth p2 <- ggplot(test, aes( result,subject))+ p2 # ptoduce the plot but let us try freeing the y axis p3 <- ggplot(test, aes( result,subject))+ p3 sessionInfo() locale: [5] LC_TIME=English_United States.1252 attached base packages: other attached packages: loaded via a namespace (and not attached): On Fri, Jan 22, 2016 at 2:13 PM, Lionel Henry notifications@github.com
|
thanks. Let's move to https://github.com/lionel-/gghorizon/issues/1 so that Hadley doesn't get notified all the time ;) |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
This makes it easy to flip a layout horizontally on a layer basis as opposed to a plot basis (with
coord_flip()
). In addition to being convenient, this allows plots that are not currently possible becausefacet_wrap()
does not allow coordinates filpping, or in situations where only some layers should be flipped.