theme_guide | R Documentation |
This function has shorthand names for theme elements relating to guides. It
is intended to be used as the guide_*(theme)
argument. Because of this
intent, and due to legends and axes having mutually exclusive theme elements,
this function sets the elements for both simultaneously.
theme_guide(
text = NULL,
line = NULL,
title = NULL,
subtitle = NULL,
text.position = NULL,
title.position = NULL,
subtitle.position = NULL,
ticks = NULL,
minor.ticks = NULL,
mini.ticks = NULL,
ticks.length = NULL,
minor.ticks.length = NULL,
mini.ticks.length = NULL,
spacing = NULL,
group.spacing = NULL,
key = NULL,
key.size = NULL,
key.width = NULL,
key.height = NULL,
key.spacing = NULL,
key.spacing.x = NULL,
key.spacing.y = NULL,
key.margin = NULL,
frame = NULL,
byrow = NULL,
background = NULL,
margin = NULL,
bracket = NULL,
bracket.size = NULL,
box = NULL,
fence = NULL,
fence.post = NULL,
fence.rail = NULL
)
text |
An |
line |
An |
title |
An |
subtitle |
An |
text.position , title.position , subtitle.position |
One of
|
ticks |
An |
minor.ticks |
An |
mini.ticks |
An |
ticks.length , minor.ticks.length , mini.ticks.length |
A
[
|
spacing , group.spacing |
A [ |
key |
An |
key.size , key.width , key.height |
A |
key.spacing , key.spacing.x , key.spacing.y |
A [ |
key.margin |
A |
frame |
An |
byrow |
A |
background |
An |
margin |
A |
bracket |
An |
bracket.size |
A [ |
box |
An |
fence , fence.post , fence.rail |
An
|
A <theme>
object that can be provided to a guide.
red_ticks <- theme_guide(ticks = element_line(colour = "red", linewidth = 0.5))
# Both axis and colourbar gain red ticks
ggplot(mpg, aes(displ, hwy, colour = cty)) +
geom_point() +
guides(
colour = guide_colourbar(theme = red_ticks),
x = guide_axis(theme = red_ticks)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.