From 098cb7aaac09a2c2ea33d207d7d22b7155a78b59 Mon Sep 17 00:00:00 2001 From: Abhilash Lakshman <46469834+abhilashlakshman@users.noreply.github.com> Date: Fri, 9 Jul 2021 16:22:22 -0400 Subject: [PATCH] Update subplots.R To get rid of "Error is get_domains(length(plots), nrows, margin, widths = widths, heights = heights): The sum of the widths and heights arguments must be less than 1. --- R/subplots.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/subplots.R b/R/subplots.R index 5374a11127..7eedf3afa0 100644 --- a/R/subplots.R +++ b/R/subplots.R @@ -372,7 +372,7 @@ get_domains <- function(nplots = 1, nrows = 1, margins = 0.01, if (any(widths < 0) | any(heights < 0)) { stop("The widths and heights arguments must contain positive values") } - if (sum(widths) > 1 | sum(heights) > 1) { + if (sum(widths) > (1 + sqrt(.Machine$double.eps)) | sum(heights) > (1 + sqrt(.Machine$double.eps))) { stop("The sum of the widths and heights arguments must be less than 1") }