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
I am trying to have the labels left and right besides the start and end nodes, respectively.
I am using the following to adjust the alignment of the labels but how can I shift them horizontally so that they move out of the nodes, i.e. the start ones to the left, the end ones to the right? Is there any aesthetic useful for that?
I achieved this by adding a data argument to geom_text/geom_label and filtering that for one value of x and then adding a second set of labels for another value of x. I also added a paste0 function to add the numbers for each node directly.
Thanks for the fix, @BoardshortsBen. I've standardised the code to work with the README example based on mtcars (without the numbers for each node because I couldn't get that portion to work). It would be awesome to have a native version of this as well.
I am trying to have the labels left and right besides the start and end nodes, respectively.
I am using the following to adjust the alignment of the labels but how can I shift them horizontally so that they move out of the nodes, i.e. the start ones to the left, the end ones to the right? Is there any aesthetic useful for that?
geom_sankey_text(aes(label=after_stat(node), hjust=ifelse(after_stat(x)==1, 1, 0)))
Otherwise, is there any stat returning the y midpoint of the nodes allowing then to use geom_text directly?
The text was updated successfully, but these errors were encountered: