Last active
October 28, 2016 04:03
-
-
Save tengpeng/eabf0135e4e4a517a925cb27fbe00870 to your computer and use it in GitHub Desktop.
Combine two ggplots into one
This file contains hidden or 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
# Original two | |
ggplot(US_Propane_Weekly, aes(as.Date(date), value)) + geom_line() + xlab("date") + ggtitle("US_Propane_Weekly") | |
ggplot(Iowa_Propane_Monthly, aes(as.Date(date), value)) + geom_line() + xlab("date") + ggtitle("Iowa_Propane_Monthly") | |
# Combine into one | |
p = ggplot(US_Propane_Weekly, aes(as.Date(date), value)) + geom_line() + xlab("date") + ggtitle("US_Propane_Weekly vs. Iowa_Propane_Monthly") | |
p = p + geom_line(data = Iowa, aes(as.Date(date), value), colour="red") | |
p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment