Relative Content

Tag Archive for ggplot2sankey-diagram

specify ggsankey color fill from center to left and right

I am building a Sankey diagram using ggsankey in R with 3 columns (org_group, main_mech, and energy_group) I want to make it so all flows from the middle column (energy group) that connect to ambient energy are red with all the others remaining grey. I have only been able to do it from left to right and have not seen a way to change the fill color of the flow based on the left node. Heres my code and first diagram attempt based on the RPubs article I found: