Follow-up to #668 / #669. That fix handles a free facet whose data collapse to a single value, but not a facet that holds no data at all.
Example using a facet facet grid, where one combo is missing, i.e. no car is both 8-cylinder and straight-engined (cyl == 8 & vs == 1).
library(tinyplot)
tinyplot(
mpg ~ wt, data = mtcars,
facet = cyl ~ vs,
facet.args = list(prefix = TRUE, free = TRUE)
)
#> Warning in min(x) : no non-missing arguments to min; returning Inf
#> Warning in max(x) : no non-missing arguments to max; returning -Inf
#> Error in par(usr = fusr[[ii]]) :
#> invalid value specified for graphical parameter "usr"
The empty panel's range() returns c(Inf, -Inf), which propagates a non-finite extent into par(usr=). The #669 guard only fires on a zero-width extent (diff(xext) == 0), so it doesn't catch this.
(Aside: this isn't specific to grids; it affects missing factor levels too.)
Fixed scales (free = FALSE) are unaffected, as are free facets given explicit xlim/ylim.
Follow-up to #668 / #669. That fix handles a free facet whose data collapse to a single value, but not a facet that holds no data at all.
Example using a facet facet grid, where one combo is missing, i.e. no car is both 8-cylinder and straight-engined (
cyl == 8 & vs == 1).The empty panel's
range()returnsc(Inf, -Inf), which propagates a non-finite extent intopar(usr=). The #669 guard only fires on a zero-width extent (diff(xext) == 0), so it doesn't catch this.(Aside: this isn't specific to grids; it affects missing factor levels too.)
Fixed scales (
free = FALSE) are unaffected, as are free facets given explicitxlim/ylim.