Draws rectangles with rounded corners in conjuction with the theme system.

element_rect_round(
  fill = NULL,
  colour = NULL,
  size = NULL,
  linetype = NULL,
  color = NULL,
  inherit.blank = FALSE,
  radius = unit(0.1, "snpc")
)

Arguments

fill

Fill colour.

colour

Line/border colour. Color is an alias for colour.

size

Line/border size in mm; 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.

color

Line/border colour. Color is an alias for colour.

inherit.blank

Should this element inherit the existence of an element_blank among its parents? If TRUE the existence of a blank element among its parents will cause this element to be blank as well. If FALSE any blank parent element will be ignored when calculating final element state.

radius

A unit of length 1 specifying the maximum radius of circles inscribing the corners. If given a numeric, it is converted to a unit object with the "snpc" unit.

x

A single number specifying size relative to parent element.

lineend

Line end Line end style (round, butt, square)

Value

A list of the class element_rect_round.

Examples

# 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() )