Last active
September 15, 2016 06:36
-
-
Save alstat/9d4f7f19152dabe9e89d to your computer and use it in GitHub Desktop.
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
| library(ggplot2) | |
| # ggplot theme to be used | |
| plotTheme <- function() { | |
| theme( | |
| panel.background = element_rect( | |
| size = 3, | |
| colour = "black", | |
| fill = "white"), | |
| axis.ticks = element_line( | |
| size = 2), | |
| panel.grid.major = element_line( | |
| colour = "gray80", | |
| linetype = "dotted"), | |
| panel.grid.minor = element_line( | |
| colour = "gray90", | |
| linetype = "dashed"), | |
| axis.title.x = element_text( | |
| size = rel(1.2), | |
| face = "bold"), | |
| axis.title.y = element_text( | |
| size = rel(1.2), | |
| face = "bold"), | |
| plot.title = element_text( | |
| size = 20, | |
| face = "bold", | |
| vjust = 1.5) | |
| ) | |
| } | |
| # Plot the image | |
| ggplot(data = imgRGB, aes(x = x, y = y)) + | |
| geom_point(colour = rgb(imgRGB[c("R", "G", "B")])) + | |
| labs(title = "Original Image: Colorful Bird") + | |
| xlab("x") + | |
| ylab("y") + | |
| plotTheme() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment