Skip to content

Commit 6e0682d

Browse files
use relative fontsize for model size numbers (#556)
* use relative fontsize for model size numbers * Update R/methods.R --------- Co-authored-by: Osvaldo A Martin <[email protected]>
1 parent e7f2158 commit 6e0682d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

R/methods.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,8 +1105,15 @@ plot.vsel <- function(
11051105
x_color_txt <- "black"
11061106
}
11071107
pp <- pp +
1108-
geom_text(aes(y = -Inf, label = .data[["size_chr"]]), vjust = -0.5,
1109-
color = x_color_txt)
1108+
if (packageVersion("ggplot2") < "4.0.0") {
1109+
geom_text(aes(y = -Inf, label = .data[["size_chr"]]), vjust = -0.5,
1110+
color = x_color_txt)
1111+
} else {
1112+
geom_text(aes(y = -Inf, label = .data[["size_chr"]],
1113+
size = from_theme(fontsize * 0.7)),
1114+
vjust = -0.5, color = x_color_txt)
1115+
1116+
}
11101117
}
11111118
# Miscellaneous stuff (axes, theming, faceting, etc.):
11121119
if (!is.na(ranking_nterms_max) && ranking_colored &&

0 commit comments

Comments
 (0)