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
Thank you for continuously improving the package, @thomasp85! Version 1.3, with the extended free() functionality and the new wrap_table() addition, is just awesome!
Regarding the documentation for 1null and -1null, I think users will benefit greatly from expanding it. In particular, clarifying how factors in front of null affect plot behavior (especially for fixed-aspect plots) would be highly valuable.
This behavior occurs because widths = unit(c(-1,1), c("null", "null")) specifies that the width ratio of p_fixed to p1 can only be 1 or lower. In other words, the widths of the plots can be equal, or p1 can be wider than p_fixed, but p_fixed can never be wider than p1.
As a result, in the final figure, as the widths approach equality, the width of p_fixed decreases to maintain the ratio of 1. Consequently, the height of p_fixed also shrinks to preserve the aspect ratio, resulting in blank spaces at the top and bottom.
To prevent this, you can set the layout to allow a higher ratio between the plot widths. For example, by setting the ratio to 5, p_fixed can extend its width until it is five times the width of p1. This adjustment gives the p_fixed plot more breathing room.
Thank you for continuously improving the package, @thomasp85! Version 1.3, with the extended
free()functionality and the newwrap_table()addition, is just awesome!Regarding the documentation for
1nulland-1null, I think users will benefit greatly from expanding it. In particular, clarifying how factors in front ofnullaffect plot behavior (especially for fixed-aspect plots) would be highly valuable.The layout below allows
p_fixedto expand as the space increases, whilep1fills the remaining space, respecting the aspect ratio of p_fixed.Let’s explore how the layout behaves when the
widthparameter is changedThe plots scale very nicely, maximizing the available space. However, if we continue decreasing the width,
p_fixedwill eventually start to shrink.Note
There are blank white spaces on top and bottom
This behavior occurs because
widths = unit(c(-1,1), c("null", "null"))specifies that the width ratio ofp_fixedtop1can only be 1 or lower. In other words, the widths of the plots can be equal, orp1can be wider thanp_fixed, butp_fixedcan never be wider thanp1.As a result, in the final figure, as the widths approach equality, the width of
p_fixeddecreases to maintain the ratio of 1. Consequently, the height ofp_fixedalso shrinks to preserve the aspect ratio, resulting in blank spaces at the top and bottom.To prevent this, you can set the layout to allow a higher ratio between the plot widths. For example, by setting the ratio to 5,
p_fixedcan extend its width until it is five times the width of p1. This adjustment gives thep_fixedplot more breathing room.Created on 2024-12-25 with reprex v2.1.0