# Load ggplot2 library
library(ggplot2)
# Create a bar chart to visualize the distribution of categories
ggplot(data, aes(x = Category)) +
geom_bar(aes(fill = Category), position = "dodge") +
theme_minimal() +
labs(
title = "Distribution of Categories",
x = "Categories",
y = "Frequency",
caption = "Source: Your Excel Data"
) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter