Skip to content

Instantly share code, notes, and snippets.

@rohit-gupta
Created September 19, 2018 13:54
Show Gist options
  • Save rohit-gupta/51cff5dbc400a7830ee2f70f56096b30 to your computer and use it in GitHub Desktop.
Save rohit-gupta/51cff5dbc400a7830ee2f70f56096b30 to your computer and use it in GitHub Desktop.
Scatter plot with neat text lables using ggrepel
# Basic Name Plot
tax_plot <- ggplot(State_Infrastructure, aes(x=tax_burden, y=percent_bad_roads, label=State))
tax_state_names_plot <- tax_plot + geom_text_repel() + geom_point(color = 'red') + theme_classic(base_size = 16)
# OUTPUT
tax_state_names_plot + ggtitle("Road Conditions vs Tax Burden") +
scale_x_continuous(name = "State and Local Tax Burden") +
scale_y_continuous(name = "Percent of roads not in good condition")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment