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
The axis_title = "collect" argument in plot_layout doesn't seem to work with facets. I'm not sure if this might be a bug, or if it was intended?
In example 1 below, plot 3 (p3, no facets) can have its axis titles collected.
In examples 2 (p3_facet_x) and 3 (p3_facet_y), the faceted side doesn't have its axis title collected.
data(mtcars)
# Create plots
p1 <- ggplot(mtcars) +
geom_point(aes(mpg, disp)) +
ggtitle('Plot 1') +
labs(x = 'X Label', y = 'Y Label')
p2 <- ggplot(mtcars) +
geom_point(aes(disp, hp)) +
ggtitle('Plot 2') +
labs(x = 'X Label', y = 'Y Label')
p3 <- ggplot(mtcars) +
geom_point(aes(drat, wt)) +
ggtitle('Plot 3a') +
labs(x = 'X Label', y = 'Y Label')
# facet plots
p3_facet_x <- ggplot(mtcars) +
geom_point(aes(drat, wt)) +
facet_grid(. ~ gear) +
ggtitle('Plot 3b') +
labs(x = 'X Label', y = 'Y Label')
p3_facet_y <- ggplot(mtcars) +
geom_point(aes(drat, wt)) +
facet_grid(gear ~ .) +
ggtitle('Plot 3c') +
labs(x = 'X Label', y = 'Y Label')
# Example 1: axis titles collect
p1 + p2 + p3 +
plot_layout(axis_titles = 'collect')
# Example 2: x-axis does not collect all the way
p1 + p2 + p3_facet_x +
plot_layout(axis_titles = 'collect')
# Example 3: y-axis does not collect all the way
p1 + p2 + p3_facet_y +
plot_layout(axis_titles = 'collect')
The text was updated successfully, but these errors were encountered:
phispu
changed the title
plot_layout(axis_title = "collect") does not work with facets. #bugplot_layout(axis_title = "collect") does not work with facets.
Sep 4, 2024
The
axis_title = "collect"
argument inplot_layout
doesn't seem to work with facets. I'm not sure if this might be a bug, or if it was intended?In example 1 below, plot 3 (p3, no facets) can have its axis titles collected.
In examples 2 (p3_facet_x) and 3 (p3_facet_y), the faceted side doesn't have its axis title collected.
The text was updated successfully, but these errors were encountered: