Skip to content

Commit 953c5d5

Browse files
committed
avoid using with() when resolving axis.ticks.length as it won't allow NULL elements in theme
1 parent 95f9529 commit 953c5d5

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

R/guides-axis.r

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,18 @@ guide_axis <- function(at, labels, position = "right", theme) {
2727

2828
at <- unit(at, "native")
2929

30-
theme$axis.ticks.length.x.bottom <- with(
31-
theme,
32-
axis.ticks.length.x.bottom %||%
33-
axis.ticks.length.x %||%
34-
axis.ticks.length
35-
)
36-
theme$axis.ticks.length.x.top <- with(
37-
theme,
38-
axis.ticks.length.x.top %||%
39-
axis.ticks.length.x %||%
40-
axis.ticks.length
41-
)
42-
theme$axis.ticks.length.y.left <- with(
43-
theme,
44-
axis.ticks.length.y.left %||%
45-
axis.ticks.length.y %||%
46-
axis.ticks.length
47-
)
48-
theme$axis.ticks.length.y.right <- with(
49-
theme,
50-
axis.ticks.length.y.right %||%
51-
axis.ticks.length.y %||%
52-
axis.ticks.length
53-
)
30+
theme$axis.ticks.length.x.bottom <- theme$axis.ticks.length.x.bottom %||%
31+
theme$axis.ticks.length.x %||%
32+
theme$axis.ticks.length
33+
theme$axis.ticks.length.x.top <- theme$axis.ticks.length.x.top %||%
34+
theme$axis.ticks.length.x %||%
35+
theme$axis.ticks.length
36+
theme$axis.ticks.length.y.left <- theme$axis.ticks.length.y.left %||%
37+
theme$axis.ticks.length.y %||%
38+
theme$axis.ticks.length
39+
theme$axis.ticks.length.y.right <- theme$axis.ticks.length.y.right %||%
40+
theme$axis.ticks.length.y %||%
41+
theme$axis.ticks.length
5442

5543
label_render <- switch(position,
5644
top = "axis.text.x.top", bottom = "axis.text.x.bottom",

0 commit comments

Comments
 (0)