You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the specific case where theme(strip.placement = "outside") is set on one plot, unexpected spacing is observed between the axes and the plot region on other plots in a patchwork.
In the reprex below, a proportion bar chart is drawn with facets and combined in a patchwork. The proprotion plot is then placed in a patchwork with a proportion plot without facets. In the second image, the same group of proportion plots is placed in a patchwork, but theme(strip.placement = "outside") is applied to the faceted proportion plot. The first patchwork renders as expected, and the second patchwork exhibits the issue with axis placement. If either plot in the second example is printed separately, the axis issue is not observed.
# Plot a/b above, with strip.placement = outside added
plot_c <-
ggplot(
sample_df,
aes(x = population, y = counts, fill = subpopulation)
) +
geom_bar(
stat = "identity",
position = "fill"
) +
facet_grid(
~ group,
scales = "free",
space = "free",
) +
theme(
strip.placement = "outside"
)
plot_d <-
ggplot(
sample_df,
aes(x = population, y = counts, fill = subpopulation)
) +
geom_bar(
stat = "identity",
position = "fill"
)
plot_c/plot_d
A summary of my OS and package versions is below.
devtools::session_info()
─ Session info ───────────────────────────────
setting value
version R version 4.3.2 (2023-10-31)
os macOS Sonoma 14.2.1
system aarch64, darwin20
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/Denver
date 2024-04-22
rstudio 2023.12.1+402 Ocean Storm (desktop)
pandoc 3.1.1 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)
In the specific case where
theme(strip.placement = "outside")
is set on one plot, unexpected spacing is observed between the axes and the plot region on other plots in a patchwork.In the reprex below, a proportion bar chart is drawn with facets and combined in a patchwork. The proprotion plot is then placed in a patchwork with a proportion plot without facets. In the second image, the same group of proportion plots is placed in a patchwork, but
theme(strip.placement = "outside")
is applied to the faceted proportion plot. The first patchwork renders as expected, and the second patchwork exhibits the issue with axis placement. If either plot in the second example is printed separately, the axis issue is not observed.A summary of my OS and package versions is below.
devtools::session_info()
The text was updated successfully, but these errors were encountered: