You are on page 1of 1

👍 🚀

Search or jump to… Pull requests Issues Marketplace Explore

thomasp85 / patchwork Watch 51 Star 1.7k Fork 133

Code Issues 26 Pull requests 1 Actions Projects Wiki Security Insights

Combine axes/scales #150 New issue

Open bwiernik opened this issue on 17 Feb · 3 comments

bwiernik commented on 17 Feb Assignees

No one assigned
I often have a case where I have two plots with the same y-axis scales that I would like to show side by side, with the axis only
showing on the outer plot. Currently, I need to manually set the axis scales to be the same across plots and set the axis to be
Labels
element_blank() for one of the plots.
None yet
Would it be possible to add functions to do these steps within the patchwork composition, similar to the legend collapsing?

Projects
12
None yet

thomasp85 commented on 17 Jun Owner Milestone

No milestone
yes, that is on the roadmap, though I can't say when it will appear

Linked pull requests


3 1
Successfully merging a pull request may close
this issue.

None yet
ashiklom commented on 23 Sep

Notifications Customize
+1 for this feature! But in the meantime, at least for axis labels, you can combine patchwork::patchworkGrob and
gridExtra::grid.arrange as a workaround. Haven't tested it extensively, but seems to do OK as a first pass: Subscribe

You’re not receiving notifications from this


library(ggplot2) thread.
library(patchwork)

p1 <- ggplot(mtcars) + 4 participants


aes(x = cyl, y = disp) +
geom_point() +
theme(axis.title = element_blank())

p2 <- p1 %+% aes(x = hp)

result <- p1 + p2
gt <- patchwork::patchworkGrob(result)
gridExtra::grid.arrange(gt, left = "Disp", bottom = "Hp // Cyl")

Created on 2020-09-22 by the reprex package (v0.3.0)

tungmilan commented on 5 Nov

+1. And if we stack plots on top of each other, it would be great if it's possible to put the common y-axis label in the middle.

Write Preview

Leave a comment

Attach
Choose files by dragging
Files no files & dropping, selecting or pasting them.
selected

Comment

Remember, contributions to this repository should follow its code of conduct.

© 2020 GitHub, Inc. Terms Privacy Security Status Help Contact GitHub Pricing API Training Blog About

You might also like