Add optional width and height arguments save plots

Sometimes the graphs must have a special size. This adds optional
arguments for width and height.
This commit is contained in:
Jens Sauer 2020-11-19 16:14:21 +01:00
parent 792b42373e
commit 4762523c20

View File

@ -11,9 +11,9 @@
# or NULL if not needed.
# Default filesize is 3000x3000 px and 300 dpi resolution.
#
sma_plot_file <- function(fname, ftype, fun) {
sma_plot_file <- function(fname, ftype, fun, width = 3000, height = 3000) {
# Open file for writing
ftype(filename = fname, width = 3000, height = 3000, res = 300)
ftype(filename = fname, width = width, height = height, res = 300)
#
# Write plot into variable, then printing it manually. This is