Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

generates the red HRC logo.

View equality.R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
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)

why are you using p <- code -> p what does this mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.