Description Usage Arguments Details Author(s) Examples
Uses the Harry Potter color scale.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | scale_color_hp(
option = "Always",
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
discrete = FALSE,
house = NULL
)
scale_colour_hp(
option = "Always",
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
discrete = FALSE,
house = NULL
)
scale_colour_hp_d(
option = "Always",
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1
)
scale_color_hp_d(
option = "Always",
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1
)
scale_fill_hp_d(
option = "Always",
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1
)
scale_fill_hp(
option = "Always",
...,
alpha = 1,
begin = 0,
end = 1,
direction = 1,
discrete = FALSE,
house = NULL
)
|
option |
A character string indicating the colourmap to use. Four houses are available: "Gryffindor", "Slytherin", "Ravenclaw" and "Hufflepuff". |
... |
parameters to |
alpha |
pass through parameter to |
begin |
The (corrected) hue in [0,1] at which the hp colormap begins. |
end |
The (corrected) hue in [0,1] at which the hp colormap ends. |
direction |
Sets the order of colors in the scale. If 1, the default, colors
are as output by |
discrete |
generate a discrete palette? (default: |
house |
A character string indicating the colourmap from a option to use. This parameter is deprectaed, 'option' should be used instead. Four houses are available: "Gryffindor", "Slytherin", "Ravenclaw" and "Hufflepuff". |
For discrete == FALSE
(the default) all other arguments are as to
scale_fill_gradientn or scale_color_gradientn.
Otherwise the function will return a discrete_scale
with the plot-computed
number of colors.
Alejandro Jiménez Rico aljrico@gmail.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(ggplot2)
ggplot(mtcars, aes(factor(cyl), fill=factor(vs))) +
geom_bar() +
scale_fill_hp(discrete = TRUE, option = "Ravenclaw")
ggplot(mtcars, aes(factor(gear), fill=factor(carb))) +
geom_bar() +
scale_fill_hp(discrete = TRUE, option = "Slytherin")
ggplot(mtcars, aes(x = mpg, y = disp, colour = hp)) +
geom_point(size = 2) +
scale_colour_hp(option = "Gryffindor")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.