I have come across this visualization and I'm trying to make a similar one.
Here is the picture!
It looks like a sankey (ofcourse there is no flow) so I tried doing a sankey with the similar results of it, but I ended up with nothing similar to that. I also tried doing it with Alluvial, but I end up with a different diagram. Could anyone please explain me what is particular visualization called how to do it.
I tried doing it with Alluvial, but I end up with a different diagram.
Here is the one I got with alluvial. The data is different from the example shown above.
Data:
df <- data.frame(Caste = c("SC","ST","OBC","FC"),
Total_population = c(0.17, 0.09, 0.52, 0.22),
Convicts = c(0.209, 0.137, 0.312, 0.341))
Code for alluvial:
ggplot(df,aes(y = Freq, axis1 = Details, axis2 = Caste)) +
geom_alluvium(fill = cols ,width = 1/12) +
geom_stratum(width = 1/12, fill = mycols, color = "grey") +
geom_label(stat = "stratum", infer.label = TRUE) +
scale_x_discrete(limits = c("Details", "Caste"), expand =c(.05,.05))+
scale_fill_brewer(type = "qual", palette = "Set1") +
ggtitle("Convict rate with total population")
This is the alluvial I have achieved
.
This is not what I want to achieve.
Things I need to know,
- how to make an exact version of this visualization.
- How to do it with only the results of the data I have, not the entire data table.
Thanks