Created
February 17, 2017 20:11
-
-
Save baptiste/c2191c3f8426889efa2352022ae90b85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(grid) | |
p <- qplot(1,1) + labs(y="y title") + | |
theme(axis.title.y = element_text(angle = 0)) | |
g <- ggplotGrob(p) | |
id <- which(g$layout$name == "ylab-l") | |
h <- grobHeight(g$grobs[[id]]) # doesn't seem to be defined | |
pos <- g$layout[id, "t"]-1 | |
g <- gtable::gtable_add_rows(g, unit(2,"line"), pos = pos) | |
g$layout[id, c("l", "r", "t", "b")] <- g$layout[id, c("l", "r", "t", "b")] + c(1,1,-1,-1) | |
grid.newpage() | |
grid.draw(g) |
Author
baptiste
commented
Feb 17, 2017
Thanks! Seems like the same approach @thomasp85 came up with: https://gist.github.com/bhaskarvk/229cca8dfd067cfbcb3074c85b950abb#file-orgs_by_size-csv
oh, didn't see that. That's the problem with people posting questions on random forums, duplication of efforts, and difficulty in finding them. I usually say no to anything that's not on SO these days, I guess that's a good reminder to stick to the rule
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment