Skip to content

Commit ae77fab

Browse files
committed
null facets measure axes in cm
1 parent 1800a9a commit ae77fab

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

R/facet-null.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,16 @@ FacetNull <- ggproto("FacetNull", Facet,
6060
zeroGrob(), axis_h$bottom, zeroGrob()
6161
), ncol = 3, byrow = TRUE)
6262
z_matrix <- matrix(c(5, 6, 4, 7, 1, 8, 3, 9, 2), ncol = 3, byrow = TRUE)
63-
grob_widths <- unit.c(grobWidth(axis_v$left), unit(1, "null"), grobWidth(axis_v$right))
64-
grob_heights <- unit.c(grobHeight(axis_h$top), unit(abs(aspect_ratio), "null"), grobHeight(axis_h$bottom))
63+
grob_widths <- unit.c(
64+
unit(width_cm(axis_v$left), "cm"),
65+
unit(1, "null"),
66+
unit(width_cm(axis_v$right), "cm")
67+
)
68+
grob_heights <- unit.c(
69+
unit(height_cm(axis_h$top), "cm"),
70+
unit(abs(aspect_ratio), "null"),
71+
unit(height_cm(axis_h$bottom), "cm")
72+
)
6573
grob_names <- c("spacer", "axis-l", "spacer", "axis-t", "panel", "axis-b", "spacer", "axis-r", "spacer")
6674

6775
layout <- gtable_matrix("layout", all,

0 commit comments

Comments
 (0)