@@ -265,15 +265,24 @@ ggplot_gtable.ggplot_built <- function(data) {
265
265
}
266
266
267
267
# Title
268
- title <- element_render(theme , " plot.title" , plot $ labels $ title , margin_y = TRUE )
268
+ title <- element_render(
269
+ theme , " plot.title" , plot $ labels $ title ,
270
+ margin_y = TRUE , margin_x = TRUE
271
+ )
269
272
title_height <- grobHeight(title )
270
273
271
274
# Subtitle
272
- subtitle <- element_render(theme , " plot.subtitle" , plot $ labels $ subtitle , margin_y = TRUE )
275
+ subtitle <- element_render(
276
+ theme , " plot.subtitle" , plot $ labels $ subtitle ,
277
+ margin_y = TRUE , margin_x = TRUE
278
+ )
273
279
subtitle_height <- grobHeight(subtitle )
274
280
275
281
# whole plot annotation
276
- caption <- element_render(theme , " plot.caption" , plot $ labels $ caption , margin_y = TRUE )
282
+ caption <- element_render(
283
+ theme , " plot.caption" , plot $ labels $ caption ,
284
+ margin_y = TRUE , margin_x = TRUE
285
+ )
277
286
caption_height <- grobHeight(caption )
278
287
279
288
# positioning of title and subtitle is governed by plot.title.position
0 commit comments