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
There's no warning message, the text layer just disappears.
This is bad for me because I'd prefer to be able to teach beginners all five position adjustments without having to teach them the position = position_nudge() syntax. The second syntax is a bit overwhelming for someone new to R since it contains a function inside an argument. (We begin new R students with ggplot2 because visualizations are cool.)
The text was updated successfully, but these errors were encountered:
Why don't you just call nudge_y = -0.1? I think I've tweaked the geoms enough that you shouldn't need to teach the long position form at all in an intro call - you can use nudge_x and nudge_y in geom_jitter(), and width and height in geom_jitter().
Thinking about this more, I think that position_nudge() is not a proper position adjustment since it does not handle collisions within the same layer. This suggests that nudge_x and nudge_y might fit into the grammar as parameters of position_identity(), e.g. position_identity(nudge_x = 0, nudge_y = 0).
That solution would take effort to implement, but then we'd:
@garrettgman, Both position_jitter and position_nudge do not handle collisions. Collision detection and handling is not a necessity for position adjustments, rather it is just what some position adjustments will also do to give a sensible looking plot.
About the default values for position_nudge, zero-zero nudge does indeed seem to be the best option.
As the main use-case for nudging is when labelling, a useful nudge value will most likely be plot specific and in many cases along a single axis. If you try to have a default non-zero constant adjustment along any or both axes, then you force users to override both.
@has2k1 your argument is defensible. I think it depends on how far you want to stray from Leland's grammar which called position adjustments "collision modifiers." Leland's grammar can certainly be improved upon; it didn't have layers for example. This may be one of those improvements.
However, position = "nudge" still fails with no error message (it silently removes the text geom from the plot), which makes me feel that this issue is not completely resolved.