We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How do we annotate a ggplot object result from wrap_ggplot_grob() with tags ?
wrap_ggplot_grob()
library(patchwork) library(grid) library(gtable) library(ggplot2) p1 <- ggplot(mtcars) + geom_point(aes(mpg, disp)) + ggtitle('disp and mpg seems connected') p2 <- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group = gear)) # Convert p2 so we can add new stuff to it p2_table <- ggplotGrob(p2) stamp <- textGrob('TOP SECRET', rot = 35, gp = gpar(fontsize = 72, fontface = 'bold') ) p2_table <- gtable_add_grob(p2_table, stamp, t = 1, l = 1, b = nrow(p2_table), r = ncol(p2_table) ) # Adding it directly will loose alignment p1 + p2_table
# Use wrap_ggplot_grob to keep alignment p1 + wrap_ggplot_grob(p2_table) + plot_annotation(tag_levels = "A")
Created on 2024-05-14 with reprex v2.1.0
The text was updated successfully, but these errors were encountered:
7560cba
No branches or pull requests
How do we annotate a ggplot object result from
wrap_ggplot_grob()
with tags ?Created on 2024-05-14 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: