You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that if a main title has been added with plot_annotation(title), it is not possible to remove it/NULLify it ex-post? This is possible with ggplot2 with ggtitle(NULL), and very useful (say keep for analysis plots with title yet remove titles for publication, as title will be included in the text software?), is it possible to do with patchwork too?
# But not possible with patchwork?p3<-p1+p2+ plot_annotation('This is a title I want to remove ex-post', caption='made with patchwork')
p3+ plot_annotation(title=NULL)
Hi, I just found an alternative way to remove the title added in plot_annotation (PS: I'm not using the same patchwork version, but I think it should work for version 1.0.1)
library(ggplot2)
library(patchwork)
packageVersion("patchwork")
#> [1] '1.1.1'p1<- ggplot(mtcars) + geom_point(aes(mpg, disp)) + ggtitle("Some Tiltle")
p2<- ggplot(mtcars) + geom_boxplot(aes(gear, disp, group=gear))
p3<-p1+p2+ plot_annotation('This is a title I want to remove ex-post', caption='made with patchwork')
p3$patches$annotation$title<-NULLp3
Hi
It seems that if a main title has been added with
plot_annotation(title)
, it is not possible to remove it/NULLify it ex-post? This is possible with ggplot2 withggtitle(NULL)
, and very useful (say keep for analysis plots with title yet remove titles for publication, as title will be included in the text software?), is it possible to do withpatchwork
too?Thanks!
Created on 2020-07-01 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: