Skip to content
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

facetting with free axes #1

Closed
lionel- opened this issue Jan 26, 2016 · 1 comment
Closed

facetting with free axes #1

lionel- opened this issue Jan 26, 2016 · 1 comment

Comments

@lionel-
Copy link
Owner

lionel- commented Jan 26, 2016

From @smouksassi

require(gghorizon)
require(ggplot2)

set <- factor(rep(1:3, each=50), labels=c("DRUG A","DRUG B","Vehicle"))
subject <- factor(rep(1:6, each=25),
                 labels=c("A","B","C","D","E","F"))
result <- rnorm(150)
test <- data.frame(set, subject, result)

p <- ggplot(test, aes(subject, result))+
  geom_boxplot()+
  facet_grid(. ~ set)
p

p1 <- ggplot(test, aes(subject, result))+
  geom_boxplot()+
  facet_grid(. ~ set, space="free",
                             scales="free_x")

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))+
  geom_boxploth()+
  facet_grid(set ~.)

p2 # ptoduce the plot but let us try freeing the y axis


p3 <- ggplot(test, aes( result,subject))+
  geom_boxploth()+
  facet_grid(set ~.,scales="free_y")

p3
#Error in panel$y_scales[[this_panel$SCALE_Y]] : subscript out of bounds
@lionel-
Copy link
Owner Author

lionel- commented Jan 28, 2016

Now fixed, let me now if you find anything else fishy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant