View source: R/element_rect_round.R
element_rect_round | R Documentation |
Draws rectangles with rounded corners in conjuction with the theme system.
element_rect_round(
fill = NULL,
colour = NULL,
linewidth = NULL,
linetype = NULL,
color = NULL,
inherit.blank = FALSE,
radius = unit(0.1, "snpc")
)
fill |
Fill colour. |
colour , color |
Line/border colour. Color is an alias for colour. |
linewidth |
Line/border size in mm. |
linetype |
Line type. An integer (0:8), a name (blank, solid, dashed, dotted, dotdash, longdash, twodash), or a string with an even number (up to eight) of hexadecimal digits which give the lengths in consecutive positions in the string. |
inherit.blank |
Should this element inherit the existence of an
|
radius |
A |
x |
A single number specifying size relative to parent element. |
lineend |
Line end Line end style (round, butt, square) |
A list
of the class element_rect_round
.
# Adding rounded rectangles to geoms and theme elements
ggplot(mpg, aes(class, colour = class)) +
geom_bar_theme(element = element_rect_round(radius = 0.25)) +
facet_grid(~ year) +
theme(
strip.background = element_rect_round(radius = 0.5),
panel.background = element_rect_round()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.