# NOT RUN {
library(ggplot2)
# ripped from the pages of ggplot2
ggplot(mtcars, aes(wt, mpg)) +
geom_point(size=4, aes(colour = factor(cyl))) +
scale_color_hp(discrete=TRUE, house = "Gryffindor") +
theme_bw()
# ripped from the pages of ggplot2
dsub <- subset(diamonds, x > 5 & x < 6 & y > 5 & y < 6)
dsub$diff <- with(dsub, sqrt(abs(x-y))* sign(x-y))
ggplot(dsub, aes(x, y, colour=diff)) +
geom_point() +
scale_colour_hp(house = "Ravenclaw") +
theme_bw()
# from the main hp example
dat <- data.frame(x = rnorm(10000), y = rnorm(10000))
ggplot(dat, aes(x = x, y = y)) +
geom_hex() +
coord_fixed() +
scale_fill_hp(house = "Hufflepuff") +
theme_bw()
# }
Run the code above in your browser using DataLab