Skip to content

Instantly share code, notes, and snippets.

@jxu
Last active May 17, 2024 19:55
Show Gist options
  • Save jxu/0a1ca767201017ad2398fafde4e73d21 to your computer and use it in GitHub Desktop.
Save jxu/0a1ca767201017ad2398fafde4e73d21 to your computer and use it in GitHub Desktop.
More googling
# Horizontal bar chart, ordered by value
ggplot(df, aes(x = reorder(name, value), y = value)) +
geom_bar(stat = "identity") +
labs(title = "Title", x = "Name", y = "Value") +
scale_y_continuous(expand = c(0,0)) +
coord_flip() +
theme_light()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment