Skip to content

Commit

Permalink
Remove use of packageVersion()
Browse files Browse the repository at this point in the history
Since ggplot2 min version is 3.3.4, then it'll always be title. So the code could be simplified.
  • Loading branch information
schloerke authored Nov 20, 2023
1 parent 8e05816 commit 3e83c91
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions R/gg-plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -1128,14 +1128,7 @@ get_x_axis_labels <- function(p, xRange) {
}
NULL
}
name <-
if (packageVersion("ggplot2") >= 3.3) {
"title"
} else {
"axis.text.x"
}

xAxisGrob <- get_raw_grob_by_name(axisTable, name)
xAxisGrob <- get_raw_grob_by_name(axisTable, "title")

axisBreaks <- as.numeric(xAxisGrob$label)

Expand Down

0 comments on commit 3e83c91

Please sign in to comment.