如何在 GGPubr 中制作 "bold" 数据标签?
How make "bold" data labels in GGPubr?
我想在 ggbarplot 中使用粗体值,但我真的不知道该怎么做。 yscale 必须是“百分比”
x <- pierwsze %>%
group_by(treatment_groups,sex) %>%
count() %>%
ggpubr::ggbarplot(
x = "treatment_groups",
fill = "sex",
y = "n",
label = TRUE, lab.col = "black", lab.vjust = 1.2,
position = position_fill(),
palette = get_palette(palette = "Oranges",5)
)+
labs(x="Treatment Group",y="Proportion",fill="Sex")+
yscale("percent",.format = TRUE)+
font("xy.text",size=10)
这里是打印粗体标签的解决方案。
q <- ggplot_build(x)
x + geom_text(data=q$data[[2]], aes(x=x, y=y, label=label),
fontface="bold", vjust=1.2)
我想在 ggbarplot 中使用粗体值,但我真的不知道该怎么做。 yscale 必须是“百分比”
x <- pierwsze %>%
group_by(treatment_groups,sex) %>%
count() %>%
ggpubr::ggbarplot(
x = "treatment_groups",
fill = "sex",
y = "n",
label = TRUE, lab.col = "black", lab.vjust = 1.2,
position = position_fill(),
palette = get_palette(palette = "Oranges",5)
)+
labs(x="Treatment Group",y="Proportion",fill="Sex")+
yscale("percent",.format = TRUE)+
font("xy.text",size=10)
这里是打印粗体标签的解决方案。
q <- ggplot_build(x)
x + geom_text(data=q$data[[2]], aes(x=x, y=y, label=label),
fontface="bold", vjust=1.2)