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
Both cowplot and patchwork define generics as_grob(). However, cowplot exports it and patchwork does not. It seems like the easiest solution for now, to avoid any immediate problems, would be to rename the internal patchwork function. If you agree, I'm happy to prepare a PR.
Going forward, we should have a discussion of what this type of function should do and where it should live. The main difference I see is that your function doesn't open a background device for as_grob.ggplot() whereas mine does. I think both approaches are needed. When you're calling as_grob.ggplot() during the final output phase, for example as part of a ggsave() call, then opening a background device is not needed (and is actually harmful). But if you're calling as_grob.ggplot() before final output is generated, e.g. because you're aligning plots that will be output later, then not having an open background device can cause weird bugs in some settings, at least it has done so for me in the past (wilkelab/cowplot#24wilkelab/cowplot#51wilkelab/cowplot#73wilkelab/cowplot#82).
The text was updated successfully, but these errors were encountered:
Both cowplot and patchwork define generics
as_grob()
. However, cowplot exports it and patchwork does not. It seems like the easiest solution for now, to avoid any immediate problems, would be to rename the internal patchwork function. If you agree, I'm happy to prepare a PR.Going forward, we should have a discussion of what this type of function should do and where it should live. The main difference I see is that your function doesn't open a background device for
as_grob.ggplot()
whereas mine does. I think both approaches are needed. When you're callingas_grob.ggplot()
during the final output phase, for example as part of aggsave()
call, then opening a background device is not needed (and is actually harmful). But if you're callingas_grob.ggplot()
before final output is generated, e.g. because you're aligning plots that will be output later, then not having an open background device can cause weird bugs in some settings, at least it has done so for me in the past (wilkelab/cowplot#24 wilkelab/cowplot#51 wilkelab/cowplot#73 wilkelab/cowplot#82).The text was updated successfully, but these errors were encountered: