Created
March 10, 2020 07:07
-
-
Save selva86/77c709c86d148562ff26a92283ef1cf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modify the following code to remove the legend title. Then, place the legend in top left position | |
gg <- ggplot(midwest, aes(x=area, y=poptotal)) + # Define Data | |
geom_point(aes(col=state, size=popdensity)) + # Add scatterplot | |
geom_smooth(method="lm", col="firebrick", se=F) + # Add best fit line | |
coord_cartesian(xlim=c(0, 0.1), ylim=c(0, 250000)) + # Limit X and Y axis | |
labs(title="Area Vs Population", y="Population", x="Area") # Labels | |
plot(gg) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment