-
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
Labels do not align correctly in 12 panel figure using Cowplot - plot_grid #32
Comments
Apparently this is caused by the fact that the label font is proportional width. The effect of You can see that if all labels are the same, then there is no problem:
Of course that won't help you much. One solution would be to provide individual
Thanks for pointing this out. I wasn't aware of this issue, and I may have to modify the way label placement is done in |
Perfect. |
I used plot_grid to generate a 12 (3 row by 4 col) panel figure, however, I was not able to get the alignment correct for the 3rd row after "hjust = -6".
Thank you for your time and help!
PP1 <- ggplot(mpg, aes(x = cty, y = hwy, colour = factor(cyl))) + geom_point(size = 2.5)
....
PP12 <- ggplot(mpg, aes(x = cty, y = hwy, colour = factor(cyl))) + geom_point(size = 2.5)
plot3by4 <- plot_grid(PP1, PP2, PP3, PP4, PP5, PP6, PP7, PP8, PP9, PP10, PP11, PP12, labels=c("A", "B", "C", "D","E", "F", "G", "H", "I", "J", "K", "L"), ncol = 4, nrow = 3, align = 'v', hjust=-6, label_size=17)
save_plot("plot3by4.png", plot3by4, ncol = 4, nrow = 3, base_aspect_ratio = 1 )
The text was updated successfully, but these errors were encountered: