Skip to contents

The save_figure() function is used to save plots to files. The cropped argument will also save a plot without additional margins, title or footer.

my_plot <- shape_plot(ckbplotr_shape_data[ckbplotr_shape_data$is_female == 0,],
                      col.x        = "rf",
                      col.estimate = "est",
                      col.stderr   = "se",
                      col.n        = "n",
                      xlims        = c(15, 50),
                      ylims        = c(0.5, 3),
                      scalepoints  = TRUE,
                      title        = NULL,
                      printplot    = FALSE,
                      showcode     = FALSE)

save_figure(my_plot$plot,
            name = "Figure 1",
            title = "Figure 1: My example shape plot",
            cropped = TRUE)