小编Gal*_*ose的帖子

ggplot / ggpubr:导出绘图时忽略 annotate_figure

ggarrange()我正在尝试注释我使用包中安排的绘图网格ggpubr。为此,我annotate_figure()在生成绘图后使用该函数。

我的问题:当以交互方式进行操作时(即不使用我的绘图创建文件),它工作得很好,但是当我导出文件(使用ggexport())时,注释不会显示。

示例: 参见文档中给出的示例

data("ToothGrowth")
df <- ToothGrowth
df$dose <- as.factor(df$dose)

# Create some plots
# ::::::::::::::::::::::::::::::::::::::::::::::::::
# Box plot
bxp <- ggboxplot(df, x = "dose", y = "len", color = "dose", palette = "jco")
# Dot plot
dp <- ggdotplot(df, x = "dose", y = "len", color = "dose", palette = "jco")
# Density plot
dens <- ggdensity(df, x = "len", fill = "dose", palette = "jco")

# Arrange and annotate …
Run Code Online (Sandbox Code Playgroud)

r ggplot2 gridextra ggpubr

3
推荐指数
1
解决办法
4323
查看次数

标签 统计

ggplot2 ×1

ggpubr ×1

gridextra ×1

r ×1