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
Reacted by Lluís Revilla, Mickaël Canouil, Lars Børty Nielsen, Teng Gao, Melissa Wolf, Kael Huerta Acuña, Rico Derks, Milan Wiedemann, Joshua Rosenberg, Jonas Oppenlaender and 1 more
Maybe unname_grob needs to be called recursively on the guides.
EDIT2: Following my previous reprex, I think the issue comes from the new unit class used in grid.
# R 4.0.0x<-unnamed[[1]]$grobs[[1]]$grobs[[1]]$grobs[[2]]$children[[1]]$widths[[2]]
y<-unnamed[[2]]$grobs[[1]]$grobs[[1]]$grobs[[2]]$children[[1]]$widths[[2]]
all.equal(x, y, check.names=FALSE, check.attributes=FALSE)
#> [1] "Component 1: Component 2: Component 1: Component 2: Component 9: 1 string mismatch" # this is the location of the component '$name : chr "GRID.text.509"', in the sub element of classes "text", "grob" and "gDesc"
class(x)
#> [1] "unit" "unit_v2"
class(y)
#> [1] "unit" "unit_v2"
Reacted by András Svraka, MagnusNordmo, Lucio Queiroz, Yuki Takahashi, zhenpeng yu, Ming Tang, Marcel Raab, noriakis, Matthias Grenié, Avinno Faruk and 1 more
Activity
bling1000 commentedon Apr 29, 2020
The same happened to me ! I updated my R version to 4.0.0 recently.
pathways plot: patchwork bug
mikecuoco commentedon May 1, 2020
Same happened to me after I updated to R 4.0.0
teng-gao commentedon May 9, 2020
+1 My R is 3.6.1
hexuebao commentedon May 11, 2020
Same happened to me after I updated to R 4.0.0
MMJansen commentedon May 18, 2020
Anyone know if a solution is to be expected soon? If I can help in anyway, please let me know.
llrs commentedon May 18, 2020
No idea, but it would help if someone could find the source of the problem. At least then it would be easier to fix it (via PR or Thomas himself).
thomasp85 commentedon May 18, 2020
I will look into this within a week or two
mcanouil commentedon Jun 1, 2020
So I took a look into that issue and the behaviour of all.equal is not the same in R 4.0.0 on grobs (https://github.com/thomasp85/patchwork/blob/master/R/guides.R#L31).
Although, I don't know (yet) how to fix this.
thomasp85 commentedon Jun 1, 2020
thanks - yeah, I suspected some change in
all.equal()was the root causemcanouil commentedon Jun 2, 2020
For the ones more expert in
gridthan me, the challenge to solve the issue is to return TRUE with the following code (in R 4.0.0):EDIT:
Maybe unname_grob needs to be called recursively on the guides.
EDIT2: Following my previous reprex, I think the issue comes from the new unit class used in grid.
RobinM92 commentedon Jun 9, 2020
Is there a workaround for now that we can use?
mcanouil commentedon Jun 9, 2020
Yes, to manually remove the duplicated legends.
RobinM92 commentedon Jun 9, 2020
Thanks, logical! To combine this with the legend positions new problems arise of course.
E.g.
vs
Both are not ideal, but if you define the position for the first legend and then remove the later ones it works as we want to:
mcanouil commentedon Jun 9, 2020
Use guides to remove the legend then