Skip to contents

Create a trajectory plot

Usage

plot_trajectory(data, center_y = FALSE, perc_y_scale = FALSE)

Arguments

data

A data frame like the outputs of prep_trajectory().

  • (Optional) If present, the column label is used for data labels.

center_y

Logical. Use TRUE to center the y-axis around start value (the default behavior of qplot_trajectory()), or use FALSE to not center.

perc_y_scale

Logical. FALSE defaults to using no label conversion. Use TRUE to convert labels on y-axis to percentage using scales::percent (the default behavior of qplot_trajectory()).

Value

An object of class "ggplot".

See also

Examples

# plot with `qplot_trajectory()` parameters
data <- subset(
  market_share,
  sector == "power" &
    technology == "renewablescap" &
    region == "global" &
    scenario_source == "demo_2020"
) %>%
  prep_trajectory()

plot_trajectory(
  data,
  center_y = TRUE,
  perc_y_scale = TRUE
)