Cannot see the complete plot for all values of variable

Hmm, doesn't look like it attached to the email.

In general, the recommended procedure for this forum is to include a reprex (FAQ: What's a reproducible example (`reprex`) and how do I do one?). It makes it a lot easier for others to help if they can understand the input, the output, and how that's different from what you wanted. I haven't encountered the behavior you're seeing except when there was something accidentally wrong with the source data.

In the meantime, a few quick ideas to try:

  • What if you remove the limits in scale_y_continuous? In case the Teenage data is inadvertently outside that range.
  • What are the results if you sample a few rows of the Teenagers_percent and Kids_percent rows? Are any of the rows coming up NA or the wrong type for rows with Teenagers? Is ggplot2 giving any warnings? Often you'll get something about # of rows not showing which were either filtered out or which had un-mappable data for one or more of the plotted dimensions. You need those rows to have working YEAR, value, variable, and RACE to show up.
population_proj_2012_race_age_groups %>%
  filter(variable %in% c("Teenagers_percent", "Kids_percent"),
         YEAR < 2020, RACE == "NHPI") # arbitrarily to get a small subset from one facet
2 Likes