-
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
tag position inside plot borders #4297
Comments
If you wrap a text annotation, it's not that cumbersome to achieve similar effects. The library(ggplot2)
place_label <- function(label, size = 5, ...) {
annotate("text", label = label, x = -Inf, y = Inf,
hjust = 0, vjust = 1, size = size, ...)
}
p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp))
p1 + place_label("a)") Created on 2021-01-09 by the reprex package (v0.3.0) |
Wow, thank you! I had no clue you could pass |
I also came into this issue and made a package: tagger. It's not perfect, but it might be useful! library(tagger)
library(ggplot2)
ggplot(mtcars, aes(hp, mpg)) +
geom_point() +
facet_grid(cyl ~ vs) +
tag_facets() |
I think the main benefit of having it as a proper part of the tag element is that it will allow patchwork to use the position for auto tagging |
I think adding a setting such as |
Some peer-reviewed journals (e.g. Oecologia) require figure panel labels to be inside of plot borders (although they seem to enforce these requirements inconsistently). It would be nice if there were an option like
theme(plot.tag.position = "topleftinner")
to place a label at the upper left corner of the inside of plot borders. Currently, I think I have to kludge this by tweakingtheme(plot.tag = element_text(vjust = , hjust = )
, but it's inconsistent, so I have to do this tweaking for every panel individually. Maybe there's an easier way that I don't know about?Related to: thomasp85/patchwork#222
# "b)" is slightly further in with same theme()
Created on 2020-12-15 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: