如何在 6 個組合圖的頂部添加標題ggplots?我目前使用此代碼添加一個標題,將其放置在我的 6 個地塊的中心,我將如何將它移到頂部?
這里的每一個res_plot都只是一個標準ggplot:
all_plots = res_plot1 res_plot2 res_plot3 res_plot4 res_plot5
all_plots ggtitle("Residual Plots")
uj5u.com熱心網友回復:
我從您的語法中假設您正在使用該patchwork包。在這種情況下,您可以使用plot_annotation:
library(patchwork)
res_plot1 <- res_plot2 <- res_plot3 <- res_plot4 <- res_plot5 <-
ggplot(mtcars, aes(wt, mpg)) geom_point()
all_plots <- res_plot1 res_plot2 res_plot3 res_plot4 res_plot5
all_plots plot_annotation(title = "Residual Plots")

轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/436080.html
