Skip to content

Commit 12646f8

Browse files
committed
Use justify_grobs for tag justification
1 parent b385981 commit 12646f8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

R/plot-build.r

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,10 @@ ggplot_gtable.ggplot_built <- function(data) {
283283
if (tag_pos == "manual") {
284284
xpos <- theme$plot.tag.position[1]
285285
ypos <- theme$plot.tag.position[2]
286-
tag_parent <- gTree(
287-
children = gList(tag),
288-
vp = viewport(x = xpos, y = ypos, width = tag_width, height = tag_height,
289-
just = c(theme$plot.tag$hjust, theme$plot.tag$vjust))
290-
)
286+
tag_parent <- justify_grobs(tag, x = xpos, y = ypos,
287+
hjust = theme$plot.tag$hjust,
288+
vjust = theme$plot.tag$vjust,
289+
debug = theme$plot.tag$debug)
291290
plot_table <- gtable_add_grob(plot_table, tag_parent, name = "tag", t = 1,
292291
b = nrow(plot_table), l = 1,
293292
r = ncol(plot_table), clip = "off")

0 commit comments

Comments
 (0)