When using theme(strip.placement = 'outside') for plots its seems to be throwing errors when trying to patchwork more complex layouts, it throws the following error message Error in FUN(X[[i]], ...) : subscript out of bounds
As a minimum working example I'll create two of the same plots with the exception that p1 has a theme(strip.placement = 'outside') call
If I want to combine p1 + p2 I get the above error message. However p2 + p2 behaves as expected
I had initially discovered the bug when trying to use inset_element() where the base plot is the one with the theme(strip.placement = 'outside') call so in this case p1. Interestingly if the inset plot is the one with the additional outside call then it works? i.e. p2 + inset_element(p1, left = 0.6, bottom = 0.6, right = 1, top = 1) works as expected but p1 + inset_element(p2, left = 0.6, bottom = 0.6, right = 1, top = 1) throws the FUN(X[[i]], ...) : subscript out of bounds error
I am currently running ggplot2 v3.4.2 and patchwork v1.1.2
Hi, thanks so much for the awesome package!
When using
theme(strip.placement = 'outside')
for plots its seems to be throwing errors when trying to patchwork more complex layouts, it throws the following error messageError in FUN(X[[i]], ...) : subscript out of bounds
As a minimum working example I'll create two of the same plots with the exception that
p1
has atheme(strip.placement = 'outside')
callIf I want to combine
p1 + p2
I get the above error message. Howeverp2 + p2
behaves as expectedI had initially discovered the bug when trying to use inset_element() where the base plot is the one with the
theme(strip.placement = 'outside')
call so in this casep1
. Interestingly if the inset plot is the one with the additional outside call then it works? i.e.p2 + inset_element(p1, left = 0.6, bottom = 0.6, right = 1, top = 1)
works as expected butp1 + inset_element(p2, left = 0.6, bottom = 0.6, right = 1, top = 1)
throws the FUN(X[[i]], ...) : subscript out of bounds errorI am currently running ggplot2 v3.4.2 and patchwork v1.1.2