Description Usage Arguments Details Value Author(s) Examples
View source: R/ggplot_bar_vts.R
ggplot_bar_vts()
creates a bar plot with variable bar widths and is
intended for plotting time series with variable time-step width.
1 2 | ggplot_bar_vts(data, mapping = aes(x = period, y = value, fill = variable),
ts = NULL, gaps = 0.1)
|
data |
a data frame |
mapping |
|
ts |
data frame linking periods to time steps widths and positons; defaults to REMIND values |
gaps |
gaps between bars as a fraction of the lowest bar width; defaults 0.1 (* 5 years = 0.5 years) |
If ts
is NULL
, values for the use with REMIND data are
used. If other values are needed, pass a data frame with the columns
period (coinciding with the column assigned to the x aesthetic in
data
), .ts (containing the desired width of the bars), and
.positon (containing the center point of the bars).
Use further ggplot2
functions like scales, themes and facets
as usual. Automatically splits positive and negative values for
plotting above and below zero bars.
a ggplot()
like object
Michaja Pehl
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.