Skip to content

Commit 1093705

Browse files
Update subplots.R (#1974)
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.
1 parent e2afc47 commit 1093705

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/subplots.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ get_domains <- function(nplots = 1, nrows = 1, margins = 0.01,
372372
if (any(widths < 0) | any(heights < 0)) {
373373
stop("The widths and heights arguments must contain positive values")
374374
}
375-
if (sum(widths) > 1 | sum(heights) > 1) {
375+
if (sum(widths) > (1 + sqrt(.Machine$double.eps)) | sum(heights) > (1 + sqrt(.Machine$double.eps))) {
376376
stop("The sum of the widths and heights arguments must be less than 1")
377377
}
378378

0 commit comments

Comments
 (0)