gen_widths | R Documentation |
Calculate the widths needed to fill the white space when we have unevenly spaced x-axis value
gen_widths(x)
x |
x-axis vector to plot |
weights use in geom_tile
## Not run:
df <- data.frame(
x = rep(c(2, 5, 7, 9, 12), 2),
y = rep(c(1, 2), each = 5),
z = factor(rep(1:5, each = 2))
)
w = gen_widths(df$x)
ggplot(df, aes(x, y)) +geom_tile(aes(fill = z, width=w), colour = "white")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.