-
Notifications
You must be signed in to change notification settings - Fork 84
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
Issue 161: by column with plot_grid #163
Conversation
- Added argument bycol to function call. - Calculate plots ordering if bycol is TRUE. - Moved grobs calculation to after plots ordering.
- Moved argument name position in function call. - Use FALSE instead of F. - Updated function documentation. - Added an example under `\donttest` - Updated NEWS.md
- merged to master - rebuilt documentation - added visual test - validated visual test
Somehow I'm still figuring out how to do all of this. Was there a way to do what you asked (merge to master, fix things, commit, and push) without opening a new pull request? |
Yes, you can just keep pushing commits and github automatically sees them and updates the PR. No problem though, we can work with this one. |
Sorry, one more issue. Can you try your plot reordering code for a case where |
tests/testthat/test_plot_grid.R
Outdated
@@ -27,6 +27,10 @@ test_that("basic plot arranging works", { | |||
expect_doppelganger("scaling plots", | |||
plot_grid(p1, p2, p3, labels = "AUTO", scale = c(.9, .7, .5), nrow = 1) + theme_map() # add theme_map() for plot title | |||
) | |||
|
|||
expect_doppelganger("colwise arranging", | |||
plot_grid(p1, NULL, p2, NULL, p3, NULL, byrow = FALSE) + theme_map() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd delete the last NULL
argument to test the case that the number of plots is less than rows * cols
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, yes, of course this could break things. I'll check and fix it: adding a visual test that assesses the case where the number of plots is less than rows * cols
- Matrix normally pads via recycling. - Pad matrix with NAs instead. - Update visual test to be more specific to when `num_plots < row * col`.
You were correct that having It also is coincidental the case that the previous visual test gave a false "valid" for dropping the last NULL, so I've updated it to something that wouldn't pass given the previous implementation.
|
Thanks! |
Woooo! First merged pull request! Thanks for your help :-) |
Thanks Claus and Brian for working on this request. I updated the cowplot package with |
You'll have to install the development version. remotes::install_github("wilkelab/cowplot") |
closes #161