Stacked Bar Chart ggplot2

Can anyone help me with finding a better way to visualize this data. This is data on crimes in London, 'Category' is the blanket name for type of crimes and 'Category2' is their sub category names. There are 11 main categories, and there are 53 sub categories in relation to them.

I have attempted everything, including the coord_flip and resizing the legend but i can not seem to find a way around it. Also, in the legend I can only see 44 sub categories - meaning I am missing 9 from my view. Additionally, the colour scheme for the legend is too similar and it defeats the purpose of having this key as it is difficult to identify what is what.

Please can you help me figure out a way to present this data better

Could you provide some sample data for us? That will make it a lot easier for people to help you solve your problem. If you need help creating a reproducible example, there's an explanation here.

That said, my off-the-cuff response would be to think about facetting the data. Have you tried facet_grid or facet_wrap? I'm not sure what you'd do about the legend position, but maybe that would at least help you get some ideas, since it sounds like you're looking for conceptual thoughts on how to structure this data viz.

I'd also say: ask yourself whether it's a good idea to put all of this information into a single graph. Often, when there doesn't seem to be a good way to visualize the data, it can be because you're trying to do too much all at once, and maybe there's a way to distill it down to simpler takeaways, or split it into multiple visualizations to convey your point better.

Thank you for your suggestions, they were very helpful. My problem was definitely due to the fact I was trying to show too much on one visualization.

To rectify this, I filtered the data into three separate stacked bar char visualizations.

1 Like

Great, I'm glad you were able to figure it out!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.