| plot_bars | R Documentation |
Bar chart coloured by value
plot_bars(
data,
x,
y,
horizontal = FALSE,
sort = FALSE,
cmap = "RdBu",
title = NULL
)
data |
Data frame with the two columns |
x |
Category column (for example |
y |
Value column |
horizontal |
Draw horizontal bars (for long category names) |
sort |
Sort the bars by value, largest first |
cmap |
Diverging palette name from |
title |
Plot title |
ggplot object
df <- data.frame(year = 2001:2010, dev = seq(-1, 1, length.out = 10))
plot_bars(df, "year", "dev")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.