Skip to content

Strip placement (bottom, outside) and empty slots #2622

@zz77zz

Description

@zz77zz

[issue raised at https://stackoverflow.com/questions/50385053/ggplot2-unexpected-vapply-error]

In some situations, empty slots in a row together with the "bottom" parameter lead to the following error:

"Error in vapply(row_axes, is.zero, logical(length(row_axes))) : values must be length 3, but FUN(X[[1]]) result is length 1"

library(ggplot2)

zzz <- data.frame(gp = c("a","b","c","d","e","f","g"), 
                  c1 = c(1,1,1,1,1,1,1), 
                  c2 = c(1,1,1,1,1,1,1))

ggplot(zzz, aes(x = c1, y = c2)) +
  facet_wrap(~ gp, scales = "free", nrow = 3, strip.position = "bottom") +
  geom_point() +
  theme(
    aspect.ratio = 1,
    strip.background = element_blank(),
    strip.placement = "outside"
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions