Description Usage Arguments Examples
These functions are wrappers around the ggplot2 convenience function ggsave
, for saving a plot.
They default to saving the last plot that you displayed.
The width is in each case predefined to have the correct width for
the MPI poster templates. Do adjust the height though!
There are versions for portrait and landscape poster templates, since these have different column widths.
1 2 3 4 5 6 7 8 | plot + theme_mpinl_poster()
ggsave_mpinl_poster_portrait("posterfigure_1.pdf") # The default height is
ggsave_mpinl_poster_portrait("posterfigure_2.pdf",height = 200, units = "mm")
ggsave_mpinl_poster_landscape("outputfilename_landscape.pdf")
ggsave_mpinl_poster_landscape(filename, plot = ggplot2::last_plot(),
device = NULL, path = NULL, scale = 1, width = NA, height = NA,
units = c("in", "cm", "mm"), dpi = 500, limitsize = TRUE, ...)
|
filename |
File name to create on disk. |
plot |
Plot to save, defaults to last plot displayed. |
device |
Device to use. Can be either be a device function
(e.g. |
path |
Path to save plot to (combined with filename). |
scale |
Multiplicative scaling factor. |
width |
Plot size in |
height |
Plot size in |
units |
Plot size in |
dpi |
Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types. |
limitsize |
When |
... |
Other arguments passed on to the graphics device function,
as specified by |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | mtcars2 <- within(mtcars, {
vs <- factor(vs, labels = c("V-shaped", "Straight"))
am <- factor(am, labels = c("Automatic", "Manual"))
cyl <- factor(cyl)
gear <- factor(gear)
})
library(ggplot2)
library(mpinltheme)
p1 <- ggplot(mtcars2) +
geom_point(aes(x = wt, y = mpg, colour = gear)) +
labs(title = "Fuel economy declines as weight increases",
subtitle = "(1973-74)",
x = "Weight (1000 lbs)",
y = "Fuel economy (mpg)",
colour = "Gears")
p1 + scale_colour_discrete_mpinl() + theme_mpinl_poster()
ggsave_mpinl_poster_portrait("outputfilename.pdf")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.