Created
March 27, 2013 23:21
-
-
Save JoFrhwld/5259051 to your computer and use it in GitHub Desktop.
generates the red HRC logo.
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
library(ggplot2) | |
library(grid) | |
bg <- data.frame(xmin = 0, xmax = 180, ymin = 0, ymax = 180) | |
bg_col <- rgb(0.8,0,0) | |
bars <- data.frame(xmin = c(35, 35), xmax = c(145, 145), ymin = c(45, 100), ymax = c(80, 135), groups = c("first", "second") ) | |
bars_col <- rgb(0.9, 0.56, 0.56) | |
p <- ggplot(bg, aes(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax)) + | |
geom_rect(fill = bg_col)+ | |
geom_rect(data = bars, fill = bars_col, aes(group = groups))+ | |
coord_fixed()+ | |
scale_x_continuous(expand = c(0,0))+ | |
scale_y_continuous(expand = c(0,0))+ | |
theme(line = element_blank(), | |
text = element_blank(), | |
rect = element_blank(), | |
plot.margin = unit(c(0,0,0,0), "cm"), | |
axis.ticks.margin = unit(0, "cm"), | |
axis.ticks.length = unit(0, "cm")) -> p | |
ggsave("~/equality.png", plot = p, width = 8, height = 8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why are you using
p <- code -> p
what does this mean?