From 4762523c20167d386e2146f9d124e370d1f97ca8 Mon Sep 17 00:00:00 2001 From: Jens Sauer Date: Thu, 19 Nov 2020 16:14:21 +0100 Subject: [PATCH] Add optional width and height arguments save plots Sometimes the graphs must have a special size. This adds optional arguments for width and height. --- utils.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.R b/utils.R index 33568de..7d3fca3 100644 --- a/utils.R +++ b/utils.R @@ -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