Skip to contents

A frame has a fixed aspect ratio, set by the width and by how many bars are visible. animate_race() uses this to size its device; use it when drawing a single frame yourself, so the layout is not stretched.

Usage

race_size(x, width = x$width)

Arguments

x

A ggrace object from ggrace().

width

Output width in pixels. Defaults to the width the race was built for.

Value

A named numeric vector with the width and height in pixels.

Examples

race <- ggrace(clefts_qci, qci, country, year, top_n = 10)
race_size(race)
#>  width height 
#>    736    459