View source: R/plot_2diicharts.R
The function returns a ggplot object containing a stacked bar chart showing a technology mix for different categories (portfolio, scenario, benchmark, etc.).
1 2 3 4 5 6 7 8 9 10 | plot_trajectory(
data,
plot_title = "",
x_title = "",
y_title = "",
annotate_data = FALSE,
scenario_specs_good_to_bad,
main_line_metric,
additional_line_metrics = data.frame()
)
|
data |
Filtered input data (dataframe with columns: year, metric_type, metric and value). |
plot_title |
Title of the plot (character string). |
x_title, y_title |
Title of the x- and y-axis (character string). |
annotate_data |
Flag indicating whether the data should be annotated (boolean). |
scenario_specs_good_to_bad |
Dataframe containing scenario specifications like color or label, ordered from the most to least sustainable (dataframe with columns: scenario, label, color). |
main_line_metric |
Dataframe containing information about metric that should be plotted as the main line (dataframe with columns: metric, label). |
additional_line_metrics |
Dataframe containing information about additional metrics that should be plotted as lines (dataframe with columns: metric, label). |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.