@@ -424,7 +424,6 @@ GuideAxis <- ggproto(
424424 # Unlist the 'label' grobs
425425 z <- if (params $ position == " left" ) c(2 , 1 , 3 ) else 1 : 3
426426 z <- rep(z , c(1 , length(grobs $ labels ), 1 ))
427- has_labels <- ! is_zero(grobs $ labels [[1 ]])
428427 grobs <- c(list (grobs $ ticks ), grobs $ labels , list (grobs $ title ))
429428
430429 # Initialise empty gtable
@@ -452,13 +451,13 @@ GuideAxis <- ggproto(
452451
453452 # Add null-unit padding to justify based on eventual gtable cell shape
454453 # rather than dimensions of this axis alone.
455- if (has_labels && params $ position %in% c(" left" , " right" )) {
454+ if (params $ position %in% c(" left" , " right" )) {
456455 where <- layout $ l [- c(1 , length(layout $ l ))]
457456 just <- rotate_just(element = elements $ text )$ hjust %|| % 0.5
458457 gt <- gtable_add_cols(gt , unit(just , " null" ), pos = min(where ) - 1 )
459458 gt <- gtable_add_cols(gt , unit(1 - just , " null" ), pos = max(where ) + 1 )
460459 }
461- if (has_labels && params $ position %in% c(" top" , " bottom" )) {
460+ if (params $ position %in% c(" top" , " bottom" )) {
462461 where <- layout $ t [- c(1 , length(layout $ t ))]
463462 just <- rotate_just(element = elements $ text )$ vjust %|| % 0.5
464463 gt <- gtable_add_rows(gt , unit(1 - just , " null" ), pos = min(where ) - 1 )
0 commit comments