Open hathawayj opened 6 years ago
This code works
household %>% ggplot(aes(x = household_wages/100000)) + # geom_rect(data = state_labels, aes(fill = p90), # xmin = -Inf, ymin = -Inf, xmax = Inf, ymax = Inf, alpha = 0.5, # inherit.aes = FALSE) + stat_ecdf(geom = "step", pad = TRUE) + theme_bw() + scale_x_continuous(breaks = seq(0, 30, by = 7)) + geom_hline(color = "darkgrey", yintercept = c(.1, .9)) + labs(x = "Household income (100,000 INR)", y = "Proportion", title = "Distribution of Household Income") + facet_wrap(~stateid, labeller = labeller(stateid = label_wrap_gen(10)))
But when I switch to facet_geo() the labels do not wrap
facet_geo()
household %>% ggplot(aes(x = household_wages/100000)) + # geom_rect(data = state_labels, aes(fill = p90), # xmin = -Inf, ymin = -Inf, xmax = Inf, ymax = Inf, alpha = 0.5, # inherit.aes = FALSE) + stat_ecdf(geom = "step", pad = TRUE) + theme_bw() + scale_x_continuous(breaks = seq(0, 30, by = 7)) + geom_hline(color = "darkgrey", yintercept = c(.1, .9)) + labs(x = "Household income (100,000 INR)", y = "Proportion", title = "Distribution of Household Income") + facet_geo(~stateid, grid = india_grid2, labeller = labeller(stateid = label_wrap_gen(10)))
I can create a reproducible example if you need.
please reproducible example with reprex() package
reprex()
This code works
But when I switch to
facet_geo()
the labels do not wrapI can create a reproducible example if you need.