render_rect: Render a rect.

Description Usage Arguments Examples

Description

A rect is defined by the coordinates of its sides. Bars and tiles are convenient parameterisations based on the length of the sides.

Usage

1
2
3
4
5
6
render_rect(data, x1, y1, x2, y2)

render_bar(data, x, y, width = resolution(x) * 0.9, halign = 0.5)

render_tile(data, x, y, width = resolution(x), height = resolution(y),
  halign = 0.5, valign = 0.5)

Arguments

data

A data frame.

x1,y1,x2,y2

Describe a rectangle by the locations of its sides.

x,y,width,height

Describe a rectangle by location and dimension.

halign,valign

Horizontal and vertical aligned. Defaults to 0.5, centered.

Examples

1
2
3
4
5
6
7
# Two equivalent specifications
render_rect(mtcars, ~cyl - 0.5, ~gear - 0.5, ~cyl + 0.5, ~gear + 0.5)
render_tile(mtcars, ~cyl, ~gear, 1, 1)

bar_ex
bar_ex %>% plot()
bar_ex %>% geometry_stack() %>% plot()

rstudio/gggeom documentation built on May 28, 2019, 4:35 a.m.