0

I have a figure depicting incidence over time showing a line tracking incidence, confidence ribbons, and colored bars indicating the introduction of a vaccine. I want to change the y-axis to make the y-values smaller so that the incidence line is more visible, including cutting off the error ribbon if I have to. How would I do that?

a = ggplot(data=d5y, aes(x=year_firstpcv, y=incidence)) +
  geom_line(size=1, colour="lightslateblue") +
  labs(title=paste("Serotype 2 IPD Incidence rate per 100,000 relative to year of PCV introduction, Age <5 years")) +
  geom_vline(data=d3, mapping=aes(xintercept=pcv13_intro, size=0.1), alpha=0.2, color="dark green") +
  geom_vline(data=d3, mapping=aes(xintercept=pcv7_intro, size=0.1), alpha=0.2, color="dark blue") +
  geom_vline(data=d3, mapping=aes(xintercept=pcv10_intro, size=0.1), alpha=0.2, color="yellowgreen") +
  geom_ribbon(data=f13, aes(x=year_firstpcv, ymin=ci.lowst2, ymax=ci.highst2), linetype=2, alpha=0.15, 
              fill="lightskyblue") +
  scale_x_continuous(limits=c(-10,18), breaks=c(-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18)) +
  scale_y_continuous() +
  theme(panel.border = element_blank(), panel.grid.major = element_blank(), panel.background = element_blank(),
        axis.title.x = element_blank(),axis.title.y = element_blank()) +
  facet_wrap(.~site, scales="free", ncol=4) +
  theme(legend.position="none") +
  labs(x="Year relative to PCV introduction", y="Incidence per 100,000")

a

Produces this plot:

Incidence facet plot

camille
  • 16,432
  • 18
  • 38
  • 60
mxiao11
  • 1
  • 1
  • 1
    For a better explanation make a [**minimal reproducible example (MRE)**](https://stackoverflow.com/a/5963610/11570343) of your data using `dput`. – cdcarrion Sep 19 '22 at 15:59

0 Answers0