Skip to content

Highlighting cohorts born in year spans  #8

@Annathal

Description

@Annathal

Hi! I am trying to create a lexis plot where I highlight an area of several years for my cohorts, and then I would like to change the colors to separate each cohort. I achieve the desired look by using this code but I cannot manage to change colors when I use a span of years:

p <- lexis_grid(year_start = 1953, year_end = 2016, age_start = 0, age_end = 70, delta = 10, lwd=0.1) %>%
lexis_cohort(cohort = 1953) %>%
lexis_cohort(cohort = 1966,2016) %>%
lexis_cohort(cohort = 1985,2016)
p <- p + labs(x = "Year", y = "Age", title = "LexisPlotR")
p

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions