element_roundrect | R Documentation |
round rectangle borders and backgrounds
element_roundrect(
fill = NULL,
colour = NULL,
size = NULL,
linetype = NULL,
color = NULL,
r = grid::unit(0.1, "snpc"),
inherit.blank = FALSE
)
fill |
Fill colour. |
colour , color |
Line/border colour. Color is an alias for colour. |
size |
text size in pts. |
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. |
r |
the radius of the rounded corners, a |
inherit.blank |
Should this element inherit the existence of an
|
library(ggplot2)
p <- ggplot(mpg, aes(displ, cty)) + geom_point()
p <- p + facet_grid(cols = vars(cyl))
p <- p + theme(strip.background=element_roundrect(fill="grey40", color=NA, r=0.15))
p
p2 <- ggplot(mtcars, aes(mpg, disp, color=factor(cyl), size=cyl)) +
geom_point()
p2 + theme(legend.background=element_roundrect(color="#808080", linetype=2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.